home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks96 / RoasterJavaWAHTTPCGI.sit / Roaster-Java-WA-HTTP-CGI hack / JavaWebStuff / RoasterVM.h < prev    next >
C/C++ Source or Header  |  1996-06-22  |  119KB  |  4,299 lines

  1. /*  ----------------------------------------------------------------------
  2.  *    File: RoasterVM.h
  3.  *  ----------------------------------------------------------------------
  4.  *    Description:
  5.  *        Java Runtime Interface for the Roaster™ VM
  6.  *
  7.  *    Written by:
  8.  *        Mimir Reynisson
  9.  *
  10.  *    History:
  11.  *        6/19/96--    Adam - Polished interface to reflect current API.
  12.  *        12/14/95--    First release.
  13.  *        02/24/96--    Rewrote the interface to conform with the JRI.
  14.  *
  15.  *    © Copyright 1995-96 by Natural Intelligence, Inc. All rights reserved.
  16.  *  ---------------------------------------------------------------------- */
  17.  
  18. #ifndef __RoasterVM__
  19. #define __RoasterVM__
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. # ifndef _STDIO
  26. # include <stdio.h>
  27. # endif
  28.  
  29. # ifndef _STDLIB
  30. # include <stdlib.h>
  31. # endif
  32.  
  33. # ifndef _STDARG
  34. # include <stdarg.h>
  35. # endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41. #define ROASTER_MAC
  42.  
  43. #define JRI_MAJOR_VERSION    1
  44. #define JRI_MINOR_VERSION    0
  45.  
  46. #define JavaSigBooleanID    'Z'
  47. #define JavaSigByteID        'B'
  48. #define JavaSigCharID        'C'
  49. #define JavaSigShortID        'S'
  50. #define JavaSigIntID        'I'
  51. #define JavaSigLongID        'J'
  52. #define JavaSigFloatID        'F'
  53. #define JavaSigDoubleID        'D'
  54. #define JavaSigVoidID        'V'
  55. #define JavaSigArrayID        '['
  56. #define JavaSigParamBeginID    '('
  57. #define JavaSigParamEndID    ')'
  58. #define JavaSigObjectID        'L'
  59.  
  60. #define JavaSigBoolean        "Z"
  61. #define JavaSigByte            "B"
  62. #define JavaSigChar            "C"
  63. #define JavaSigShort        "S"
  64. #define JavaSigInt            "I"
  65. #define JavaSigLong            "J"
  66. #define JavaSigFloat        "F"
  67. #define JavaSigDouble        "D"
  68. #define JavaSigVoid            "V"
  69.  
  70. #define JavaSigArray(T)        "[" T
  71. #define JavaSigClass(C)        "L" C ";"
  72. #define JavaSigString        JavaSigClass("java/lang/String")
  73. #define JavaSigArgs(A)        "(" A ")"
  74.  
  75. #define Package_java_lang    "java/lang/"
  76. #define Package_java_io        "java/io/"
  77. #define Package_java_net    "java/net/"
  78. #define Package_java_util    "java/util/"
  79.  
  80. /*
  81.  * The opaque type representing a reference to a Roaster object.
  82.  *
  83.  * Although Roaster objects are garbage collected, RoasterRefs are given
  84.  * out to C programs to prevent the garbage collector from collecting
  85.  * a given object. Whenever a native method returns, all references
  86.  * allocated but not made global are automatically disposed. Discarding
  87.  * RoasterRefs may be done explicitly via the RoasterRef_disposeGlobal
  88.  * operation (for global references), and the RoasterEnv_revertToRefFrame
  89.  * (for local references)
  90.  */
  91.  
  92. typedef UInt32 JavaRef;
  93.  
  94. /*
  95.  * The following enum specifies special constant values of type JavaRef
  96.  */
  97.  
  98. typedef enum JavaRefConstant {
  99.     JavaTrue            = 1,
  100.     JavaFalse            = 0,
  101.     JavaNull            = 0,
  102.     JavaClassBoolean    = -1,
  103.     JavaClassByte        = -2,
  104.     JavaClassChar        = -3,
  105.     JavaClassInteger    = -4,
  106.     JavaClassLong        = -5,
  107.     JavaClassFloat        = -6,
  108.     JavaClassDouble        = -7,
  109.     JavaClassIdent        = -8,
  110.     JavaClassString        = -9,
  111.     JavaClassByteArray    = -10,
  112.     JavaClassObjArray    = -11
  113. } JavaRefConstant;
  114.  
  115. /*
  116.  * The following enum specifies the different low-level security
  117.  * modes available. Additional security can be implemented in the
  118.  * java library itself, and controlled through properties. These
  119.  * security modes are largely a concern for environments which
  120.  * must execute Java code from unkown sources.
  121.  */
  122.  
  123. typedef enum JavaSecurityMode {
  124.     JavaSecurity_allow_stdout    =    0x00000001,
  125.     JavaSecurity_allow_stderr    =    0x00000002,
  126.     JavaSecurity_allow_stdin    =    0x00000004,
  127.     JavaSecurity_allow_net        =    0x00000008,
  128.     JavaSecurity_allow_jit        =    0x00000010
  129. } JavaSecurityMode;
  130.  
  131. /*
  132.  * This opaque type represents and instance of a Roaster runtime
  133.  * environment. The runtime environment contains all classes which
  134.  * are loaded and accessible from Java and defines the mapping from
  135.  * names to classes. It also contains the heap which contains all
  136.  * currently available objects.
  137.  */
  138.  
  139. typedef struct JavaRuntimeStruct *JavaRuntime;
  140.  
  141. /* This opaque type represents a point on the stack to which
  142.  * control may be returned.
  143.  */
  144.  
  145. typedef UInt32 JavaCatchFrame;
  146.  
  147. /*
  148.  * This opaque type is used to demarcate groups of references which
  149.  * have been returned by the JRI and disposed of together.
  150.  */
  151.  
  152. typedef UInt32 JavaRefFrame;
  153.  
  154. /*
  155.  * The opaque type representing the Roaster execution environment
  156.  * structure. The execution environment defines the context in
  157.  * which references may be dereferenced and embodies the execution
  158.  * stack of the currently active Java methods.
  159.  */
  160.  
  161. typedef struct JavaEnvStruct *JavaEnv;
  162.  
  163. typedef short JavaStatus;
  164.  
  165. typedef enum JavaStatusCode {
  166.     JavaStatusOk                = 1,
  167.     JavaStatusOutOfMemory        = -1,
  168.     JavaStatusParamError        = -2,
  169.     JavaStatusTypeError            = -3,
  170.     JavaStatusNotFound            = -4,
  171.     JavaStatusExceptionThrown    = -5,
  172.     JavaStatusInternalError        = -6
  173. } JavaStatusCode;
  174.  
  175. /*
  176.  * The flag values which indicate various access privileges for
  177.  * fields, methods, and classes.
  178.  */
  179.  
  180. typedef enum JavaAccessFlags {
  181.     /* Field and Method Access */
  182.     JavaAccessMember            = 0x0000,
  183.     JavaAccessPublic            = 0x0001,
  184.     JavaAccessProtected            = 0x0002,
  185.     JavaAccessPrivate            = 0x0004,
  186.     JavaAccessStatic            = 0x0008,
  187.     JavaAccessFinal                = 0x0010,
  188.     JavaAccessSynchronized        = 0x0020,
  189.     JavaAccessNative            = 0x0100,
  190.     /* Class Access */
  191.     JavaAccessInterface            = 0x0200,
  192.     JavaAccessAbstract            = 0x0400
  193. } JavaAccessFlags;
  194.  
  195. /*
  196.  * This enum specifies the optional interfaces which may be passed
  197.  * to the JavaRuntime_supports() operation.
  198.  */
  199.  
  200. typedef enum JavaSupports {
  201.     JavaSupportsCompile,
  202.     JavaSupportsEval,
  203.     JavaSupportsDebug,
  204.     JavaSupportsProfile
  205. } JavaSupports;
  206.  
  207. #ifdef ROASTER_MAC
  208. #define ROASTER_MSB_ORDER
  209. typedef wide int64;
  210. typedef struct FSSpec *JavaDirSpec;
  211. typedef Boolean Bool;
  212. #elif WIN32
  213. #undef ROASTER_MSB_ORDER
  214. typedef BOOL Bool;
  215. typedef __int64 int64;
  216. typedef unsigned char UInt8;
  217. typedef unsigned short UInt16;
  218. typedef unsigned long UInt32;
  219. typedef char *JavaDirSpec;
  220. #endif
  221.  
  222. typedef char     JavaBoolean;
  223. typedef char     JavaByte;
  224. typedef UInt16     JavaChar;
  225. typedef short     JavaShort;
  226. typedef long     JavaInt;
  227. typedef int64     JavaLong;
  228. typedef float     JavaFloat;
  229. typedef double     JavaDouble;
  230.  
  231. typedef void *JavaOSThread;
  232.  
  233. /*
  234.  * This type describes the initialization arguments to the
  235.  * JavaRuntime_make() routine. The JavaRuntime_make() routine
  236.  * is defined this way to allow for future upward compatibility.
  237.  *
  238.  * The arguments described here represent the 1.0 version (i.e.
  239.  * majorVersion == 1, minorVersion == 0).
  240.  *
  241.  * Fields:
  242.  *            majorVersion :    The major version of the initialization
  243.  *                            arguments to the runtime instance. Major
  244.  *                            versions change when the initialization
  245.  *                            arguments change in an incompatible way.
  246.  *
  247.  *            minorVersion :    The minor version of the initialization
  248.  *                            arguments to the runtime instance. Minor
  249.  *                            versions change when the initialization
  250.  *                            arguments change in a compatible way.
  251.  *
  252.  *         initialHeapSize :    The size of the initial heap partition to
  253.  *                            allocate.
  254.  *
  255.  *    dynamicHeapChunkSize :    The size of each chunk of memory allocated
  256.  *                            to garbage collected objects.
  257.  *
  258.  *     staticHeapChunkSize :    The size of each chunk of memory allocated
  259.  *                            to static memory blocks.
  260.  *
  261.  *             maxHeapSize :    The maximum heap size which the runtime
  262.  *                            will allow to be allocated. If set to
  263.  *                            JAVA_HEAP_UNLIMITED, the heap will be
  264.  *                            allowed to grow indefinitely, until no
  265.  *                            more memory can be allocated (although
  266.  *                            this is not to say that garbage collection
  267.  *                            wouldn't occur long before memory allocation
  268.  *                            fails).
  269.  *
  270.  *     collectionStartProc :    This function is called whenever a garbage
  271.  *                            collection starts. If NULL, no notification
  272.  *                            will be made, but garbage collection will
  273.  *                            still occur.
  274.  *
  275.  *       collectionEndProc :    This function is called whenever a garbage
  276.  *                            collection is completed. If NULL, no notication
  277.  *                            will be made.
  278.  *                            
  279.  */
  280.  
  281. #define JAVA_HEAP_UNLIMITED        0
  282.  
  283. /*
  284.  * Callback:    JavaCollectionStartProc
  285.  *
  286.  * Description:
  287.  *                The signature of the routine which is called whenever
  288.  *                garbage collection starts. Applications can use this
  289.  *                hook to put up a status message or watch cursor.
  290.  *
  291.  * Parameters:
  292.  *                runtime    : The runtime instance.
  293.  */
  294.  
  295. typedef void (*JavaCollectionStartProc)(JavaRuntime runtime);
  296.  
  297. /*
  298.  * Callback:    JavaCollectionEndProc
  299.  *
  300.  * Description:
  301.  *                The signature of the routine which is called whenever
  302.  *                garbage collection ends. Applications can use this
  303.  *                hook to put up a status message or remove a watch cursor.
  304.  *
  305.  * Parameters:
  306.  *                runtime    : The runtime instance.
  307.  */
  308.  
  309. typedef void (*JavaCollectionEndProc)(JavaRuntime runtime);
  310.  
  311. /*
  312.  * Callback:    JavaAllocateProc
  313.  *
  314.  * Description:
  315.  *                The signature of the routine which is called whenever
  316.  *                Roaster needs to allocate memory.
  317.  *
  318.  * Parameters:
  319.  *               blockLen : The amount of memory to allocate.
  320.  *
  321.  * Return value:
  322.  *              [pointer]    : The newly allocate block of memory.
  323.  *                   NULL    : Failure to allocate the given block of memory.
  324.  */
  325.  
  326. typedef void *(*JavaAllocateProc)(size_t blockLen);
  327.  
  328. /*
  329.  * Callback:    JavaDisposeProc
  330.  *
  331.  * Description:
  332.  *                The signature of the routine which is called whenever
  333.  *                Roaster needs to dispose memory.
  334.  *
  335.  * Parameters:
  336.  *                    ptr : The pointer to dispose of.
  337.  */
  338.  
  339. typedef void (*JavaDisposeProc)(void *ptr);
  340.  
  341. /*
  342.  * Callback:    JavaMakeClassLoader
  343.  *
  344.  * Description:
  345.  *                .
  346.  */
  347.  
  348. typedef JavaStatus (*JavaMakeClassLoader)(JavaRuntime runtime, void *args, void **storage);
  349.  
  350. /*
  351.  * Callback:    JavaDisposeClassLoader
  352.  *
  353.  * Description:
  354.  *                .
  355.  */
  356.  
  357. typedef JavaStatus (*JavaDisposeClassLoader)(JavaRuntime runtime, void **storage);
  358.  
  359. /*
  360.  * Callback:    JavaLoadClassProc
  361.  *
  362.  * Description:
  363.  *                .
  364.  *
  365.  * Parameters:
  366.  */
  367.  
  368. typedef JavaStatus (*JavaLoadClassProc)(JavaRuntime runtime,
  369.     char *className, JavaRef *classRef, void **storage, Bool resolve);
  370.  
  371. /*
  372.  * Callback:    JavaExitHandlerProc
  373.  *
  374.  * Description:
  375.  *                .
  376.  *
  377.  * Parameters:
  378.  */
  379.  
  380. typedef JavaStatus (*JavaExitHandlerProc)(JavaRuntime runtime, void *exitData);
  381.  
  382. #if PRAGMA_ALIGN_SUPPORTED
  383. #pragma options align=mac68k
  384. #endif
  385.  
  386. typedef struct JavaRuntimeInitargs {
  387.     short                    majorVersion;
  388.     short                    minorVersion;
  389.     size_t                    initialHeapSize;
  390.     size_t                    dynamicHeapChunkSize;
  391.     size_t                    staticHeapChunkSize;
  392.     size_t                    maxHeapSize;
  393.     JavaCollectionStartProc    collectionStartProc;
  394.     JavaCollectionEndProc    collectionEndProc;
  395.  
  396.     /* Roaster specific fields */
  397.     JavaAllocateProc        heapAllocationProc;
  398.     JavaDisposeProc            heapDisposeProc;
  399.     JavaAllocateProc        gcHeapAllocationProc;
  400.     JavaDisposeProc            gcHeapDisposeProc;
  401.  
  402.     OSType                    outputFileCreator;
  403.     OSType                    outputFileType;
  404.  
  405.     JavaDirSpec                homeDirectory;
  406.     JavaDirSpec                javaDirectory;
  407. } JavaRuntimeInitargs;
  408.  
  409. #define JavaRuntimeStatusStructVersion 1
  410.  
  411. typedef struct JavaRuntimeStatusStruct {
  412.     size_t                    statusVersion;
  413.     size_t                    dynamicHeapAllocated;
  414.     size_t                    staticHeapAllocated;
  415.     size_t                    dynamicHeapUsed;
  416.     size_t                    staticHeapUsed;
  417.     size_t                    numberOfClasses;
  418.     size_t                    memoryUsedByClasses;
  419.     size_t                    numberOfObjects;
  420.     size_t                    memoryUsedByObjects;
  421.     size_t                    numberOfArrays;
  422.     size_t                    memoryUsedByArrays;
  423.     size_t                    methodHashMiss;
  424.     size_t                    methodHashHit;
  425.     size_t                    fieldHashMiss;
  426.     size_t                    fieldHashHit;
  427.     size_t                    numberOfThreads;
  428.     size_t                    numberOfClientConnections;
  429.     size_t                    numberOfServerConnections;
  430. } *JavaRuntimeStatus;
  431.  
  432. #if PRAGMA_ALIGN_SUPPORTED
  433. #pragma options align=reset
  434. #endif
  435.  
  436. /*
  437.  * Function:    JavaRuntime_makeDefaultInitArgs
  438.  *
  439.  * Description:
  440.  *                Initializes an initialization arguments block.
  441.  *
  442.  * Parameters:
  443.  *               initargs    : § The initialization to initialize.
  444.  */
  445.  
  446. void
  447. JavaRuntime_makeDefaultInitArgs(JavaRuntimeInitargs *initargs);
  448.  
  449. /*
  450.  * Function:    JavaRuntime_make
  451.  *
  452.  * Description:
  453.  *                Initializes and returns a new Roaster runtime instance.
  454.  *                If a new runtime instance cannot be constructed (either
  455.  *                because of limited resources or incompatible initialization
  456.  *                arguments) NULL is returned.
  457.  *
  458.  *                This routine is defined in terms of an initialization
  459.  *                arguments structure in order to allow for future upward
  460.  *                compatibility.
  461.  *
  462.  * Parameters:
  463.  *               initargs    : The initialization arguments for a
  464.  *                          new runtime instance.
  465.  *
  466.  * Return value:
  467.  *              [pointer]    : The newly created runtime instance.
  468.  *                   NULL    : The runtime instance failed to be allocated.
  469.  */
  470.  
  471. JavaStatus
  472. JavaRuntime_make(JavaRuntimeInitargs *initargs, JavaRuntime *outRuntime);
  473.  
  474. /*
  475.  * Function:    JavaRuntime_status
  476.  *
  477.  * Description: Returns a filled-in status structure.
  478.  *
  479.  * Parameters:
  480.  *                runtime    : The runtime instance.
  481.  */
  482.  
  483. JavaStatus
  484. JavaRuntime_status(JavaRuntime runtime, JavaRuntimeStatus status);
  485.  
  486. /*
  487.  * Function:    JavaRuntime_connectDebugger
  488.  *
  489.  * Description: Connect a debugger to the runtime interface.
  490.  *
  491.  * Parameters:
  492.  *                runtime    : The runtime instance.
  493.  */
  494.  
  495. JavaStatus
  496. JavaRuntime_connectDebugger(JavaRuntime runtime, JavaDirSpec launchSpec);
  497.  
  498. /*
  499.  * Function:    JavaRuntime_debuggerConnected
  500.  *
  501.  * Description: Verifies if a debugger is connected to the runtime.
  502.  *
  503.  * Parameters:
  504.  *                runtime    : The runtime instance.
  505.  */
  506.  
  507. JavaStatus
  508. JavaRuntime_debuggerConnected(JavaRuntime runtime);
  509.  
  510. /*
  511.  * Function:    JavaRuntime_pushClassLoader
  512.  *
  513.  * Description: Pushes a new classloader onto the stack of loaders.
  514.  *                The runtime uses loaders from top to bottom in the stack
  515.  *                to resolve a class.
  516.  *
  517.  * Parameters:
  518.  *                runtime    : The runtime instance.
  519.  */
  520.  
  521. JavaStatus
  522. JavaRuntime_pushClassLoader(JavaRuntime runtime,
  523.     JavaMakeClassLoader    make, JavaDisposeClassLoader dispose,
  524.         JavaLoadClassProc loadClass, void *initArgs);
  525.  
  526. /*
  527.  * Function:    JavaRuntime_pushClassFileLoader
  528.  *
  529.  * Description: Pushes a loader for classfiles onto the runtime stack.
  530.  *
  531.  * Parameters:
  532.  *                runtime    : The runtime instance.
  533.  */
  534.  
  535. JavaStatus
  536. JavaRuntime_pushClassFileLoader(JavaRuntime runtime, JavaDirSpec homeDir);
  537.  
  538. /*
  539.  * Function:    JavaRuntime_pushZipClassLoader
  540.  *
  541.  * Description:    Pushes a loader for Zip files onto the runtime stack.
  542.  *
  543.  * Parameters:
  544.  *                runtime    : The runtime instance.
  545.  */
  546.  
  547. JavaStatus
  548. JavaRuntime_pushZipClassLoader(JavaRuntime runtime, JavaDirSpec zipFile);
  549.  
  550. /*
  551.  * Function:    JavaRuntime_pushExitHandler
  552.  *
  553.  * Description:    Installs a callback for when the runtime exits.
  554.  *
  555.  * Parameters:
  556.  *                runtime    : The runtime instance.
  557.  */
  558.  
  559. JavaStatus
  560. JavaRuntime_pushExitHandler(JavaRuntime runtime,
  561.     JavaExitHandlerProc exitHandler, void *exitData);
  562.  
  563. /*
  564.  * Function:    JavaRuntime_dispose
  565.  *
  566.  * Description:
  567.  *                Disposes a Java runtime instance. This cleanly shuts down
  568.  *                the Java runtime, freeing all resources associated with it.
  569.  *                After disposing a runtime, all operations associated with
  570.  *                execution environments constructed from that runtime, and
  571.  *                all references associated with those execution environments
  572.  *                becomes undefined.
  573.  *
  574.  * IMPORTANT:
  575.  *                After disposing a runtime instance, all references to that
  576.  *                instance become invalid and should not be used.
  577.  *
  578.  * Parameters:
  579.  *                runtime    : The runtime instance.
  580.  */
  581.  
  582. void
  583. JavaRuntime_dispose(JavaRuntime runtime);
  584.  
  585. /*
  586.  * Function:    JavaRuntime_exitInternal
  587.  *
  588.  * Description:    
  589.  *                Calls Runtime.exitInternal() from Java, which can be overridden.
  590.  *                The default implementation is to quit the application.  This has
  591.  *                the effect of terminating the running applet or Java app.
  592.  *
  593.  * Parameters:
  594.  *                runtime    : The runtime instance.
  595.  *
  596.  *               exitCode : The exit code returned to the OS on some platforms.
  597.  */
  598.  
  599. JavaStatus
  600. JavaRuntime_exitInternal(JavaRuntime runtime, JavaInt exitCode);
  601.  
  602. /*
  603.  * Function:    JavaRuntime_getHomeDirectory
  604.  *
  605.  * Description:
  606.  *                Gets the directory where the applet was run from.
  607.  *
  608.  * Parameters:
  609.  *                runtime    : The runtime instance.
  610.  *
  611.  * Return value:
  612.  *                 [pointer] : .
  613.  */
  614.  
  615. JavaDirSpec
  616. JavaRuntime_getHomeDirectory(JavaRuntime runtime);
  617.  
  618. /*
  619.  * Function:    JavaRuntime_getJavaDirectory
  620.  *
  621.  * Description:
  622.  *                Gets the directory where the JDK is installed.
  623.  *
  624.  * Parameters:
  625.  *                runtime    : The runtime instance.
  626.  *
  627.  * Return value:
  628.  *                 [pointer] : .
  629.  */
  630.  
  631. JavaDirSpec
  632. JavaRuntime_getJavaDirectory(JavaRuntime runtime);
  633.  
  634. /*
  635.  * Function:    JavaRuntime_setHomeDirectory
  636.  *
  637.  * Description:
  638.  *                Sets the running applet's root directory.
  639.  *
  640.  * Parameters:
  641.  *                runtime    : The runtime instance.
  642.  *
  643.  *                homeDir : The new home directory.
  644.  *
  645.  * Return value:
  646.  *             JavaStatusOk : Operation completed normally.
  647.  *     JavaStatusParamError : .
  648.  */
  649.  
  650. JavaStatus
  651. JavaRuntime_setHomeDirectory(JavaRuntime runtime, JavaDirSpec homeDir);
  652.  
  653. /*
  654.  * Function:    JavaRuntime_setJavaDirectory
  655.  *
  656.  * Description:
  657.  *                Sets the main search path directory for classfiles.
  658.  *
  659.  * Parameters:
  660.  *                runtime    : The runtime instance.
  661.  *
  662.  *                homeDir : The new home directory.
  663.  *
  664.  * Return value:
  665.  *             JavaStatusOk : Operation completed normally.
  666.  *     JavaStatusParamError : .
  667.  */
  668.  
  669. JavaStatus
  670. JavaRuntime_setJavaDirectory(JavaRuntime runtime, JavaDirSpec homeDir);
  671.  
  672. /*
  673.  * Function:    JavaRuntime_getOutputFileCreator
  674.  *
  675.  * Description:
  676.  *                Returns the MacOS file creator type (i.e. 'APPL').
  677.  *
  678.  * Parameters:
  679.  *                runtime    : The runtime instance.
  680.  *
  681.  * Return value:
  682.  *                 [OSType] : .
  683.  */
  684.  
  685. OSType
  686. JavaRuntime_getOutputFileCreator(JavaRuntime runtime);
  687.  
  688. /*
  689.  * Function:    JavaRuntime_getOutputFileType
  690.  *
  691.  * Description:
  692.  *                Returns the MacOS file type (i.e. 'TEXT').
  693.  *
  694.  * Parameters:
  695.  *                runtime    : The runtime instance.
  696.  *
  697.  * Return value:
  698.  *                 [OSType] : .
  699.  */
  700.  
  701. OSType
  702. JavaRuntime_getOutputFileType(JavaRuntime runtime);
  703.  
  704. /*
  705.  * Function:    JavaRuntime_setOutputFileCreator
  706.  *
  707.  * Description:
  708.  *                Sets the MacOS file creator resource.
  709.  *
  710.  * Parameters:
  711.  *                runtime    : The runtime instance.
  712.  *
  713.  * Return value:
  714.  *                 [OSType] : .
  715.  */
  716.  
  717. JavaStatus
  718. JavaRuntime_setOutputFileCreator(JavaRuntime runtime, OSType newCreator);
  719.  
  720. /*
  721.  * Function:    JavaRuntime_setOutputFileType
  722.  *
  723.  * Description:
  724.  *                Sets the MacOS file type resource.
  725.  *
  726.  * Parameters:
  727.  *                runtime    : The runtime instance.
  728.  *
  729.  * Return value:
  730.  *                 [OSType] : .
  731.  */
  732.  
  733. JavaStatus
  734. JavaRuntime_setOutputFileType(JavaRuntime runtime, OSType newType);
  735.  
  736. /*
  737.  * Function:    JavaRuntime_supports
  738.  *
  739.  * Description:
  740.  *                Tests whether a Java runtime implements an optional portion
  741.  *                of the Java interface.
  742.  *
  743.  * Parameters:
  744.  *                runtime    : The runtime instance.
  745.  *
  746.  *            optionalAPI    : The optional interface to test.
  747.  */
  748.  
  749. JavaStatus
  750. JavaRuntime_supports(JavaRuntime runtime, JavaSupports optionalAPI);
  751.  
  752. /*
  753.  * Function:    JavaRuntime_getProperty
  754.  *
  755.  * Description:
  756.  *                Retrieves a Java runtime property value. This may be
  757.  *                particularly useful to retrieve the vendor or version
  758.  *                of the Java runtime environment.
  759.  *
  760.  * Parameters:
  761.  *                runtime    : The runtime instance.
  762.  *
  763.  *               propName : The name of the property to get. The name is
  764.  *                          specified as a NULL-terminated UTF string.
  765.  *
  766.  *                 result : § The resulting property value. It is the
  767.  *                          caller's responsibility to dispose this string.
  768.  *
  769.  * Return status:
  770.  *             JavaStatusOk : Operation completed normally.
  771.  *       JavaStatusNotFound : The desired property was not found.
  772.  *    JavaStatusOutOfMemory :    The property could not be allocated.
  773.  */
  774.  
  775. JavaStatus
  776. JavaRuntime_getProperty(JavaRuntime runtime, char *propName, char **result);
  777.  
  778. /*
  779.  * Function:    JavaRuntime_setProperty
  780.  *
  781.  * Description:
  782.  *                Sets a Java runtime property value.
  783.  *
  784.  * Parameters:
  785.  *                runtime    : The runtime instance.
  786.  *
  787.  *               propName : The name of the property to set. The name is
  788.  *                          specified as a NULL-terminated UTF string.
  789.  *
  790.  *                  value : The value to which the property is to be set.
  791.  *                          The Java runtime will __COPY__ this string into
  792.  *                          it's own heap.
  793.  *
  794.  * Return status:
  795.  *             JavaStatusOk : Operation completed normally.
  796.  *    JavaStatusOutOfMemory : The property could not be allocated.
  797.  */
  798.  
  799. JavaStatus
  800. JavaRuntime_setProperty(JavaRuntime runtime, char *propName, char *value);
  801.  
  802. /*
  803.  * Callback:    JavaMethodProc
  804.  *
  805.  * Description:
  806.  *                The signature of a native method.
  807.  *
  808.  *                Note that the current method name, signature, and method
  809.  *                data can be retrieved from the execution environment via
  810.  *                JavaEnv_getCurrentMethodInfo().
  811.  *
  812.  * Parameters:
  813.  *                    env : The execution environment.
  814.  */
  815.  
  816. typedef JavaStatus
  817. (*JavaMethodProc)(JavaEnv env);
  818.  
  819. #if PRAGMA_ALIGN_SUPPORTED
  820. #pragma options align=mac68k
  821. #endif
  822.  
  823. typedef struct JavaNativeTableStruct {
  824.     char            *className;
  825.     char            *methodName;
  826.     char            *methodSignature;
  827.     JavaMethodProc    methodProc;
  828.     void            *methodData;
  829.     JavaAccessFlags    methodAccess;
  830. } JavaNativeTable;
  831.  
  832. #if PRAGMA_ALIGN_SUPPORTED
  833. #pragma options align=reset
  834. #endif
  835.  
  836. /*
  837.  * Function:    JavaRuntime_setMethod
  838.  *
  839.  * Description:
  840.  *                Unlike the JDK which relies on a dynamic linker to find
  841.  *                native methods based on a naming convention, Roaster requries
  842.  *                that native methods be explicitly registered. This eliminates
  843.  *                the need for a dynamic linker, and also allows the signature
  844.  *                of the method to play a role in the lookup process when the
  845.  *                runtime invokes a native method.
  846.  *
  847.  * Parameters:
  848.  *                runtime    : The runtime instance.
  849.  *
  850.  *                  class : The class on which the method is to be registered.
  851.  *
  852.  *             methodName : The name of the method to register. The name must
  853.  *                          be a NULL-terminated UTF string.
  854.  *
  855.  *              methodSig : The signature of the method to register. The name
  856.  *                          must be a NULL-terminated UTF string.
  857.  *
  858.  *             methodProc : A pointer to the native routine that implements
  859.  *                          the method. Setting the methodProc to NULL has the
  860.  *                          effect of unregistering any method with the specified
  861.  *                          name and signature. Setting the method when there is
  862.  *                          already a method registered has the effect of replacing
  863.  *                          the current method.
  864.  *
  865.  *             methodData : A pointer to an arbitrary piece of storage. This
  866.  *                          data will be passed to the methodProc each time
  867.  *                          it is called and may be used to store data which
  868.  *                          must persist between invocations of the method.
  869.  *                          If not needed, the method data may be NULL. Setting
  870.  *                          the method data when there is already data registered
  871.  *                          with a method has the effect of replacing the method
  872.  *                          data, so care must be taken to retrieve the current
  873.  *                          method data (via JavaRuntime_getMethod) and dispose
  874.  *                          of it properly before replacing the method data or a
  875.  *                          leak may result.
  876.  *
  877.  *               isStatic : A boolean specifying whether this method is a static
  878.  *                          (i.e. class) method, or instance method. TRUE specifies
  879.  *                          that the method is static.
  880.  *
  881.  * Return status:
  882.  *             JavaStatusOk : Operation completed normally.
  883.  *    JavaStatusOutOfMemory : The method could not be registered because
  884.  *                            memory could not be allocated.
  885.  */
  886.  
  887. JavaStatus
  888. JavaRuntime_setMethod(JavaRuntime runtime, JavaRef classRef,
  889.     char *methodName, char *methodSig, JavaMethodProc methodProc,
  890.     void *methodData, Bool isStatic);
  891.  
  892. /*
  893.  * Function:    JavaRuntime_getMethod
  894.  *
  895.  * Description:
  896.  *                Retrieves a native method from a runtime instance. This
  897.  *                may be useful if the currently registered method is to be
  898.  *                wrapped in some outer procedure.
  899.  *
  900.  * Parameters:
  901.  *                runtime    : The runtime instance.
  902.  *
  903.  *                  class : The class on which the method is to be registered.
  904.  *
  905.  *             methodName : The name of the method to register. The name must
  906.  *                          be a NULL-terminated UTF string.
  907.  *
  908.  *              methodSig : The signature of the method to register. The name
  909.  *                          must be a NULL-terminated UTF string.
  910.  *
  911.  *             methodProc : § The resulting pointer to the native routine that
  912.  *                          implements the method. Specifying a NULL pointer
  913.  *                          indicates that the result is not desired.
  914.  *
  915.  *             methodData : § The resulting pointer to the arbitrary piece of
  916.  *                          storage which was originally associated with the
  917.  *                          given native method using JavaRuntime_setMethod().
  918.  *                          Specifying a NULL pointer indicates that the result
  919.  *                          is not desired.
  920.  *
  921.  *               isStatic : § A resulting boolean indicating whether this
  922.  *                          method is a static (class) method, or instance
  923.  *                          method. TRUE specifies that the method is static.
  924.  *                          Specifying a NULL pointer indicates that the result
  925.  *                          is not desired.
  926.  *
  927.  * Return status:
  928.  *             JavaStatusOk : Operation completed normally.
  929.  *       JavaStatusNotFound : The method with the specified name and signature
  930.  *                            could not be found in the runtime instance.
  931.  */
  932.  
  933. JavaStatus
  934. JavaRuntime_getMethod(JavaRuntime runtime, JavaRef classRef,
  935.     char *methodName, char *methodSig, JavaMethodProc *methodProc,
  936.     void **methodData, Bool *isStatic);
  937.  
  938. /*
  939.  * Function:    JavaRuntime_registerNativeMethodTable
  940.  *
  941.  * Description:
  942.  *                Registers all the native methods in the specified
  943.  *                method table. The method table must include a NULL
  944.  *                terminated entry to signify the end of the table.
  945.  *
  946.  * Parameters:
  947.  *                runtime    : The runtime instance.
  948.  *
  949.  * Return status:
  950.  *             JavaStatusOk : Operation completed normally.
  951.  *       JavaStatusNotFound : The method with the specified name and signature
  952.  *                            could not be found in the runtime instance.
  953.  */
  954.  
  955. JavaStatus
  956. JavaRuntime_registerNativeMethodTable(JavaRuntime runtime, JavaNativeTable *methodTable);
  957.  
  958. /*
  959.  * Function:    JavaRuntime_getClassNameFromFile
  960.  *
  961.  * Description:
  962.  *                Gets the name of the class contained in the specified file.
  963.  *
  964.  * Parameters:
  965.  *                runtime    : The runtime instance.
  966.  *
  967.  *                   file : The class file.
  968.  *
  969.  * Return value:
  970.  *             JavaStatusOk : Operation completed normally.
  971.  *    JavaStatusOutOfMemory : The class data could not be allocated.
  972.  */
  973.  
  974. JavaStatus
  975. JavaRuntime_getClassNameFromFile(JavaRuntime runtime,
  976.     JavaDirSpec file, char *buffer, size_t length);
  977.  
  978. /*
  979.  * Function:    JavaRuntime_getClassNameFromData
  980.  *
  981.  * Description:
  982.  *                Gets the name of the class contained in the specified buffer.
  983.  *
  984.  * Parameters:
  985.  *                runtime    : The runtime instance.
  986.  *
  987.  *                   file : The class file.
  988.  *
  989.  * Return value:
  990.  *             JavaStatusOk : Operation completed normally.
  991.  *    JavaStatusOutOfMemory : The class data could not be allocated.
  992.  */
  993.  
  994. JavaStatus
  995. JavaRuntime_getClassNameFromData(JavaRuntime runtime,
  996.     char *data, size_t dataLength, char *buffer, size_t length);
  997.  
  998. /*
  999.  * Function:    JavaRuntime_loadClass
  1000.  *
  1001.  * Description:
  1002.  *                Loads a class from flattened class data.
  1003.  *
  1004.  * Parameters:
  1005.  *                runtime    : The runtime instance.
  1006.  *
  1007.  *                 result : § The resulting class object which was loaded.
  1008.  *
  1009.  *                   data : The flattened class data.
  1010.  *
  1011.  *             dataLength : The number of bytes in the class data.
  1012.  *
  1013.  * Return status:
  1014.  *             JavaStatusOk : Operation completed normally.
  1015.  *       JavaStatusNotFound : The desired class object could not be
  1016.  *                            loaded from the data.
  1017.  */
  1018.  
  1019. JavaStatus
  1020. JavaRuntime_loadClass(JavaRuntime runtime, JavaRef *result,
  1021.     char *data, size_t dataLength, Bool resolveClass);
  1022.  
  1023. /*
  1024.  * Function:    JavaRuntime_unloadClass
  1025.  *
  1026.  * Description:
  1027.  *                Unloads a class from the environment. After unloading,
  1028.  *                the class may be garbage collected (provided there are
  1029.  *                no other references to it), and JavaRuntime_findClass()
  1030.  *                will return JavaStatusNotFound.
  1031.  *
  1032.  * Parameters:
  1033.  *                runtime    : The runtime instance.
  1034.  *
  1035.  *               classRef : The class to unload.
  1036.  *
  1037.  * Return status:
  1038.  *                 JavaTrue : Operation completed normally.
  1039.  *                   JavaFalse : The class could not be unloaded (perhaps
  1040.  *                            because it is a system or built-in class).
  1041.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1042.  *      JavaStatusTypeError :    The class parameter did not specify a valid
  1043.  *                            class object.
  1044.  */
  1045.  
  1046. JavaStatus
  1047. JavaRuntime_unloadClass(JavaRuntime runtime, JavaRef classRef);
  1048.  
  1049. /*
  1050.  * Function:    JavaRuntime_findClass
  1051.  *
  1052.  * Description:
  1053.  *                Looks up a class given a name in the runtime and returns
  1054.  *                a reference to it.
  1055.  *
  1056.  * Parameters:
  1057.  *                runtime    : The runtime instance.
  1058.  *
  1059.  *                   result : § The resulting class object which was found
  1060.  *                          An actual reference to a class object may be
  1061.  *                          returned, or one of the special JavaRefConstant
  1062.  *                          values.
  1063.  *
  1064.  *                   name : The name of the class object to look up. The
  1065.  *                          name is specified as a NULL-terminated UTF
  1066.  *                          string.
  1067.  *
  1068.  * Return status:
  1069.  *             JavaStatusOk : Operation completed normally.
  1070.  *       JavaStatusNotFound : The desired class object was not found.
  1071.  */
  1072.  
  1073. JavaStatus
  1074. JavaRuntime_findClass(JavaRuntime runtime, JavaRef *result, char *name);
  1075.  
  1076. /*
  1077.  * Function:    JavaRuntime_findClassUnresolved
  1078.  *
  1079.  * Description:
  1080.  *                Looks up a class given a name in the runtime and returns
  1081.  *                a reference to it.  The class is not resolved (i.e. the
  1082.  *                superclass is not verified, etc.).  Essentially a quicker
  1083.  *                variant of JavaRuntime_findClass().  The class is always
  1084.  *                resolved when it is first used.
  1085.  *
  1086.  * Parameters:
  1087.  *                runtime    : The runtime instance.
  1088.  *
  1089.  *                   result : § The resulting class object which was found
  1090.  *                          An actual reference to a class object may be
  1091.  *                          returned, or one of the special JavaRefConstant
  1092.  *                          values.
  1093.  *
  1094.  *                   name : The name of the class object to look up. The
  1095.  *                          name is specified as a NULL-terminated UTF
  1096.  *                          string.
  1097.  *
  1098.  * Return status:
  1099.  *             JavaStatusOk : Operation completed normally.
  1100.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1101.  *       JavaStatusNotFound : The desired class object was not found.
  1102.  */
  1103.  
  1104. JavaStatus
  1105. JavaRuntime_findClassUnresolved(JavaRuntime runtime, JavaRef *result, char *name);
  1106.  
  1107. /*
  1108.  * Function:    JavaRuntime_yield
  1109.  *
  1110.  * Description:
  1111.  *                Yields to the main event loop.
  1112.  *
  1113.  * Parameters:
  1114.  *                  delay : .
  1115.  *
  1116.  * Return status:
  1117.  *             JavaStatusOk : Operation completed normally.
  1118.  *       JavaStatusNotFound : The desired class object was not found.
  1119.  */
  1120.  
  1121. JavaStatus
  1122. JavaRuntime_yield(JavaInt delay);
  1123.  
  1124. /*
  1125.  * Function:    JavaRuntime_yieldLong
  1126.  *
  1127.  * Description:
  1128.  *                Yields to the main event loop with a longer possible delay
  1129.  *                than JavaRuntime_yield().
  1130.  *
  1131.  * Parameters:
  1132.  *                  delay : .
  1133.  *
  1134.  * Return status:
  1135.  *             JavaStatusOk : Operation completed normally.
  1136.  *       JavaStatusNotFound : The desired class object was not found.
  1137.  */
  1138.  
  1139. JavaStatus
  1140. JavaRuntime_yieldLong(JavaLong delay);
  1141.  
  1142. /*
  1143.  * Function:    JavaRuntime_setLowBreakPoint
  1144.  *
  1145.  * Description:
  1146.  *
  1147.  * Parameters:
  1148.  *                  delay : .
  1149.  *
  1150.  * Return status:
  1151.  *             JavaStatusOk : Operation completed normally.
  1152.  *       JavaStatusNotFound : The desired class object was not found.
  1153.  */
  1154.  
  1155. JavaStatus
  1156. JavaRuntime_setLowBreakPoint(JavaRuntime runtime, char *className, size_t offset);
  1157.  
  1158. /*
  1159.  * Function:    JavaRuntime_getClassList
  1160.  *
  1161.  * Description:
  1162.  *                Returns the current list of loaded classes.
  1163.  *
  1164.  * Parameters:
  1165.  *                runtime    : The runtime instance.
  1166.  *
  1167.  * Return status:
  1168.  */
  1169.  
  1170. JavaRef
  1171. JavaRuntime_getClassList(JavaRuntime runtime);
  1172.  
  1173. /*
  1174.  * Function:    JavaRuntime_getNextClass
  1175.  *
  1176.  * Description:
  1177.  *                Given a class reference, the function returns a new reference
  1178.  *                to the next class in the current list of loaded classes.
  1179.  *
  1180.  * Parameters:
  1181.  *                runtime    : The runtime instance.
  1182.  *
  1183.  *               classRef : The class reference.
  1184.  *
  1185.  * Return status:
  1186.  */
  1187.  
  1188. JavaRef
  1189. JavaRuntime_getNextClass(JavaRuntime runtime, JavaRef classRef);
  1190.  
  1191. /*
  1192.  * Function:    JavaEnv_make
  1193.  *
  1194.  * Description:
  1195.  *                Constructs a new Java execution environment.
  1196.  *
  1197.  * Parameters:
  1198.  *                runtime    : The runtime instance with which this
  1199.  *                          environment is to be associated. The
  1200.  *                          runtime defines the classes that will
  1201.  *                          be accessible from the environment.
  1202.  *
  1203.  *                   thread : The platform thread upon which Java
  1204.  *                          evaluation occurs. If NULL, the current
  1205.  *                          thread is used.
  1206.  *
  1207.  * Return value:
  1208.  *              [pointer]    : The newly created execution environment.
  1209.  *                   NULL    : The execution environment failed to be
  1210.  *                          allocated.
  1211.  */
  1212.  
  1213. JavaEnv
  1214. JavaEnv_make(JavaRuntime runtime, JavaOSThread thread);
  1215.  
  1216. /*
  1217.  * Function:    JavaEnv_dispose
  1218.  *
  1219.  * Description:
  1220.  *                Disposes a Java execution environment.
  1221.  *
  1222.  * Parameters:
  1223.  *                    env    : The execution environment.
  1224.  */
  1225.  
  1226. void
  1227. JavaEnv_dispose(JavaEnv env);
  1228.  
  1229. /*
  1230.  * Function:    JavaEnv_getRuntime
  1231.  *
  1232.  * Description:
  1233.  *                Returns the runtime instance of an execution
  1234.  *                environment.
  1235.  *
  1236.  * Parameters:
  1237.  *                    env    : The execution environment.
  1238.  *
  1239.  * Return value:
  1240.  *              [pointer]    : The runtime instance.
  1241.  */
  1242.  
  1243. JavaRuntime
  1244. JavaEnv_getRuntime(JavaEnv env);
  1245.  
  1246. /*
  1247.  * Function:    JavaEnv_getSecurityMode
  1248.  *
  1249.  * Description:
  1250.  *                Returns the security mode for an execution
  1251.  *                environment.
  1252.  *
  1253.  * Parameters:
  1254.  *                    env    : The execution environment.
  1255.  *
  1256.  * Return value:
  1257.  */
  1258.  
  1259. JavaSecurityMode
  1260. JavaEnv_getSecurityMode(JavaEnv env);
  1261.  
  1262. /*
  1263.  * Function:    JavaEnv_setSecurityMode
  1264.  *
  1265.  * Description:
  1266.  *                Sets the security mode for an execution
  1267.  *                environment.
  1268.  *
  1269.  * Parameters:
  1270.  *                    env    : The execution environment.
  1271.  *
  1272.  * Return value:
  1273.  */
  1274.  
  1275. JavaStatus
  1276. JavaEnv_setSecurityMode(JavaEnv env, JavaSecurityMode newMode);
  1277.  
  1278. /*
  1279.  * Function:    JavaEnv_getThread
  1280.  *
  1281.  * Description:
  1282.  *                Returns the native thread of an execution
  1283.  *                environment.
  1284.  *
  1285.  * Parameters:
  1286.  *                    env    : The execution environment.
  1287.  *
  1288.  * Return value:
  1289.  *              [pointer]    : The native thread.
  1290.  */
  1291.  
  1292. JavaOSThread
  1293. JavaEnv_getThread(JavaEnv env);
  1294.  
  1295. /*
  1296.  * Function:    JavaEnv_getCurrentMethodInfo
  1297.  *
  1298.  * Description:
  1299.  *                Returns information about the current native
  1300.  *                method invocation and its execution environment.
  1301.  *
  1302.  * Parameters:
  1303.  *                    env    : The execution environment.
  1304.  *
  1305.  *            methodClass : § The returned class on which the current
  1306.  *                          method is defined. Specifying a NULL
  1307.  *                          pointer indicates that the result is
  1308.  *                          not desired.
  1309.  *
  1310.  *             methodName : § The returned name of the current method.
  1311.  *                          The name is an identifier. Specifying a NULL
  1312.  *                          pointer indicates that the result is not
  1313.  *                          desired.
  1314.  *
  1315.  *              methodSig : § The returned signature of the current
  1316.  *                          method. The signature is an identifier.
  1317.  *                          Specifying a NULL pointer indicates that
  1318.  *                          the result is not desired.
  1319.  *
  1320.  *             methodData : § The returned method data which was registered
  1321.  *                          with the method by JavaRuntime_setMethod()..
  1322.  *                          Specifying a NULL pointer indicates that
  1323.  *                          the result is not desired.
  1324.  *
  1325.  * Return status:
  1326.  *             JavaStatusOk : Operation completed normally.
  1327.  *       JavaStatusNotFound : The Java runtime is not currently in the
  1328.  *                            process of invoking a native method.
  1329.  */
  1330.  
  1331. JavaStatus
  1332. JavaEnv_getCurrentMethodInfo(JavaEnv env, JavaRef *methodClass,
  1333.     JavaRef *methodName, JavaRef *methodSig, void **methodData);
  1334.  
  1335. /*
  1336.  * Function:    JavaEnv_throw
  1337.  *
  1338.  * Description:
  1339.  *                Causes an exception to be thrown.
  1340.  *
  1341.  * Parameters:
  1342.  *                    env    : The execution environment.
  1343.  *
  1344.  *           exceptionRef : The exception reference to throw, must be a
  1345.  *                          subclass of java.lang.Throwable.
  1346.  *
  1347.  * Return status:
  1348.  *             JavaStatusOk : Operation completed normally.
  1349.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1350.  *      JavaStatusTypeError :    The class parameter was not a valid class
  1351.  *                            object or subclass of java.lang.Throwable.
  1352.  *  JavaStatusExceptionThrow : Some other exception was thrown by Java
  1353.  *                               in the course of trying to throw this one.
  1354.  */
  1355.  
  1356. JavaStatus
  1357. JavaEnv_throw(JavaEnv env, JavaRef exceptionRef);
  1358.  
  1359. /*
  1360.  * Function:    JavaEnv_throwNew
  1361.  *
  1362.  * Description:
  1363.  *                This convenience routine causes an exception to be
  1364.  *                constructed and thrown. The message string is included
  1365.  *                as the message field of the newly constructed exception.
  1366.  *
  1367.  * Parameters:
  1368.  *                    env    : The execution environment.
  1369.  *
  1370.  *               classRef : The class of exception to throw, must be a
  1371.  *                          subclass of java.lang.Throwable.
  1372.  *
  1373.  *                message : A NULL-terminated UTF string specifying any
  1374.  *                          error message to report. The string is copied
  1375.  *                          by the routine and must be freed by the caller.
  1376.  *
  1377.  * Return status:
  1378.  *             JavaStatusOk : Operation completed normally.
  1379.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1380.  *      JavaStatusTypeError :    The class parameter was not a valid class
  1381.  *                            object or subclass of java.lang.Throwable.
  1382.  *  JavaStatusExceptionThrow : Some other exception was thrown by Java
  1383.  *                               in the course of trying to throw this one.
  1384.  */
  1385.  
  1386. JavaStatus
  1387. JavaEnv_throwNew(JavaEnv env, char *className, char *message);
  1388.  
  1389. /*
  1390.  * Function:    JavaEnv_exceptionOccurred
  1391.  *
  1392.  * Description:
  1393.  *                Returns the current exception object if one was thrown.
  1394.  *                Actually returns the last thrown object, exception,
  1395.  *                error, throwable, or otherwise.
  1396.  *
  1397.  * Parameters:
  1398.  *                    env    : The execution environment.
  1399.  *
  1400.  * Return status:
  1401.  *              [reference] : An exception occurred and was returned as
  1402.  *                            the result of the routine.
  1403.  *                  JavaNull : There was no current exception thrown.
  1404.  */
  1405.  
  1406. JavaRef
  1407. JavaEnv_exceptionOccurred(JavaEnv env);
  1408.  
  1409. /*
  1410.  * Function:    JavaEnv_exceptionDescribe
  1411.  *
  1412.  * Description:
  1413.  *                Describes the exception which has occurred. If no
  1414.  *                exception occurred, this operation prints nothing.
  1415.  *
  1416.  * Parameters:
  1417.  *                    env    : The execution environment.
  1418.  *
  1419.  *                    out : The file pointer to which the exception
  1420.  *                          information is to be printed.
  1421.  */
  1422.  
  1423. void
  1424. JavaEnv_exceptionDescribe(JavaEnv env, FILE *out);
  1425.  
  1426. /*
  1427.  * Function:    JavaEnv_exceptionClear
  1428.  *
  1429.  * Description:
  1430.  *                Clears the current exception. This causes the
  1431.  *                environment to act as if the exception has been
  1432.  *                caught and allows subsequent evaluation to proceed
  1433.  *                normally. This operation is primarily used in
  1434.  *                conjunction with JavaEnv_revertToCatchFrame() to
  1435.  *                handle exceptions from native code.
  1436.  *
  1437.  * Parameters:
  1438.  *                    env    : The execution environment.
  1439.  */
  1440.  
  1441. void
  1442. JavaEnv_exceptionClear(JavaEnv env);
  1443.  
  1444. /*
  1445.  * Function:    JavaEnv_establishRefFrame
  1446.  *
  1447.  * Description:
  1448.  *                Creates a reference frame on the reference stack
  1449.  *                and returns it. Establishing a reference frame
  1450.  *                demarcates all subsequent references that will be
  1451.  *                returned by JRI calls and allows them to be disposed
  1452.  *                as a group (by calling JavaEnv_revertToRefFrame()).
  1453.  *
  1454.  *                Note that this operation is called automatically by
  1455.  *                the runtime before entering a native method.
  1456.  *
  1457.  * Parameters:
  1458.  *                    env    : The execution environment.
  1459.  *
  1460.  * Return value:
  1461.  *              [reference] : The reference frame.
  1462.  */
  1463.  
  1464. JavaRefFrame
  1465. JavaEnv_establishRefFrame(JavaEnv env);
  1466.  
  1467. /*
  1468.  * Function:    JavaEnv_revertToRefFrame
  1469.  *
  1470.  * Description:
  1471.  *                Reverts the reference stack to a previously established
  1472.  *                reference frame. This allows all references allocated
  1473.  *                since the reference frame was established to be disposed
  1474.  *                as a group. Only references that are made global (by
  1475.  *                calling JavaRef_makeGlobal()) will persist after calling
  1476.  *                JavaEnv_revertToRefFrame().
  1477.  *
  1478.  *                Note that this operation is called automatically by
  1479.  *                the runtime after exiting a native method.
  1480.  *
  1481.  * Parameters:
  1482.  *                    env    : The execution environment.
  1483.  *
  1484.  *               refFrame : The reference frame to which to revert.
  1485.  *
  1486.  * Return value:
  1487.  *                 JavaTrue : The operation completed normally.
  1488.  *                JavaFalse : An invalid reference frame was specified,
  1489.  *                            presumably one which has already been
  1490.  *                            popped.
  1491.  */
  1492.  
  1493. JavaStatus
  1494. JavaEnv_revertToRefFrame(JavaEnv env, JavaRefFrame refFrame);
  1495.  
  1496. /*
  1497.  * Function:    JavaEnv_pushBoolean
  1498.  *                JavaEnv_pushByte
  1499.  *                JavaEnv_pushChar
  1500.  *                JavaEnv_pushShort
  1501.  *                JavaEnv_pushInt
  1502.  *                JavaEnv_pushLong
  1503.  *                JavaEnv_pushFloat
  1504.  *                JavaEnv_pushDouble
  1505.  *                JavaEnv_pushRef
  1506.  *
  1507.  * Description: Pushes a Java variable of the appropriate type onto the
  1508.  *                current execution stack.
  1509.  *
  1510.  * Parameters:
  1511.  *                    env    : The execution environment.
  1512.  *
  1513.  *                  value : The value to push.
  1514.  *
  1515.  * Return status:
  1516.  *             JavaStatusOk : Operation completed normally.
  1517.  *     JavaStatusParamError : .
  1518.  */
  1519.  
  1520. JavaStatus
  1521. JavaEnv_pushBoolean(JavaEnv env, JavaBoolean value);
  1522.  
  1523. JavaStatus
  1524. JavaEnv_pushByte(JavaEnv env, JavaByte value);
  1525.  
  1526. JavaStatus
  1527. JavaEnv_pushChar(JavaEnv env, JavaChar value);
  1528.  
  1529. JavaStatus
  1530. JavaEnv_pushShort(JavaEnv env, JavaShort value);
  1531.  
  1532. JavaStatus
  1533. JavaEnv_pushInt(JavaEnv env, JavaInt value);
  1534.  
  1535. JavaStatus
  1536. JavaEnv_pushLong(JavaEnv env, JavaLong value);
  1537.  
  1538. JavaStatus
  1539. JavaEnv_pushFloat(JavaEnv env, JavaFloat value);
  1540.  
  1541. JavaStatus
  1542. JavaEnv_pushDouble(JavaEnv env, JavaDouble value);
  1543.  
  1544. JavaStatus
  1545. JavaEnv_pushRef(JavaEnv env, JavaRef ref);
  1546.  
  1547. /*
  1548.  * Function:    JavaEnv_popBoolean
  1549.  *                JavaEnv_popByte
  1550.  *                JavaEnv_popChar
  1551.  *                JavaEnv_popShort
  1552.  *                JavaEnv_popInt
  1553.  *                JavaEnv_popLong
  1554.  *                JavaEnv_popFloat
  1555.  *                JavaEnv_popDouble
  1556.  *                JavaEnv_popRef
  1557.  *
  1558.  * Description: Pops a Java variable of the appropriate type off the
  1559.  *                current execution stack.
  1560.  *
  1561.  * Parameters:
  1562.  *                    env    : The execution environment.
  1563.  *
  1564.  * Return value:
  1565.  */
  1566.  
  1567. JavaBoolean
  1568. JavaEnv_popBoolean(JavaEnv env);
  1569.  
  1570. JavaByte
  1571. JavaEnv_popByte(JavaEnv env);
  1572.  
  1573. JavaChar
  1574. JavaEnv_popChar(JavaEnv env);
  1575.  
  1576. JavaShort
  1577. JavaEnv_popShort(JavaEnv env);
  1578.  
  1579. JavaInt
  1580. JavaEnv_popInt(JavaEnv env);
  1581.  
  1582. JavaLong
  1583. JavaEnv_popLong(JavaEnv env);
  1584.  
  1585. JavaFloat
  1586. JavaEnv_popFloat(JavaEnv env);
  1587.  
  1588. JavaDouble
  1589. JavaEnv_popDouble(JavaEnv env);
  1590.  
  1591. JavaRef
  1592. JavaEnv_popRef(JavaEnv env);
  1593.  
  1594. /*
  1595.  * Function:    JavaRef_makeLocal
  1596.  *
  1597.  * Description:
  1598.  *                Creates a new local Java reference that refers to
  1599.  *                the object referred to by the ref parameter. Local
  1600.  *                references are automatically disposed when the
  1601.  *                native method that created them returns, or may be
  1602.  *                disposed explicitly by calling JavaEnv_revertToRefFrame().
  1603.  *
  1604.  * Parameters:
  1605.  *                    env    : The execution environment.
  1606.  *
  1607.  *                    ref : The reference to duplicate.
  1608.  *
  1609.  * Return value:
  1610.  *              [reference] : The new local reference which refers to the
  1611.  *                            original object, ref.
  1612.  *                 JavaNull : The local reference could not be allocated.
  1613.  */
  1614.  
  1615. JavaRef
  1616. JavaRef_makeLocal(JavaEnv env, JavaRef ref);
  1617.  
  1618. /*
  1619.  * Function:    JavaRef_makeGlobal
  1620.  *
  1621.  * Description:
  1622.  *                Creates a new global Java reference that refers to
  1623.  *                the object referred to by the ref parameter. Global
  1624.  *                references must be explicitly disposed by calling
  1625.  *                JavaRef_disposeGlobal().
  1626.  *
  1627.  * Parameters:
  1628.  *                    env    : The execution environment.
  1629.  *
  1630.  *                    ref : The reference to duplicate.
  1631.  *
  1632.  * Return value:
  1633.  *              [reference] : The new global reference which refers to the
  1634.  *                            original object, ref.
  1635.  *                 JavaNull : The global reference could not be allocated.
  1636.  */
  1637.  
  1638. JavaRef
  1639. JavaRef_makeGlobal(JavaEnv env, JavaRef ref);
  1640.  
  1641. /*
  1642.  * Function:    JavaRef_disposeGlobal
  1643.  *
  1644.  * Description:
  1645.  *                Disposes a Java reference. This has the effect of
  1646.  *                marking object as no longer referenced from the C world
  1647.  *                and does NOT destroy the object directly (i.e. garbage
  1648.  *                collect and/or finalize it).
  1649.  *
  1650.  * Parameters:
  1651.  *                    env    : The execution environment.
  1652.  *
  1653.  *                    ref : The reference to dispose.
  1654.  *
  1655.  * Return status:
  1656.  *             JavaStatusOk : Operation completed normally.
  1657.  *     JavaStatusParamError : The ref parameter did not specify a valid
  1658.  *                            global reference, or was a local rather
  1659.  *                            then global reference.
  1660.  */
  1661.  
  1662. JavaStatus
  1663. JavaRef_disposeGlobal(JavaEnv env, JavaRef ref);
  1664.  
  1665. /*
  1666.  * Function:    JavaRef_isGlobal
  1667.  *
  1668.  * Description:
  1669.  *                Determines whether a reference is a global reference.
  1670.  *
  1671.  * Parameters:
  1672.  *                    env    : The execution environment.
  1673.  *
  1674.  *                    ref : The reference.
  1675.  *
  1676.  * Return status:
  1677.  *                 JavaTrue : Reference is a global reference.
  1678.  *                JavaFalse : Reference is a local reference.
  1679.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1680.  */
  1681.  
  1682. JavaStatus
  1683. JavaRef_isGlobal(JavaEnv env, JavaRef ref);
  1684.  
  1685. /*
  1686.  * Function:    JavaRef_assign
  1687.  *
  1688.  * Description:
  1689.  *                Assigns one Java reference to refer to the same
  1690.  *                object as another.
  1691.  *
  1692.  * Parameters:
  1693.  *                    env    : The execution environment.
  1694.  *
  1695.  *                   dest : The reference to have its value assigned.
  1696.  *                          release the object that this reference
  1697.  *                          currently refers to and cause it to refer
  1698.  *                          to the object from the src parameter. The
  1699.  *                          dest reference remains global if it was
  1700.  *                          global, and remains local if it was local
  1701.  *                          before this routine was called.
  1702.  *
  1703.  *                    src : The reference to assign the value from.
  1704.  *                          The object referred to by this reference
  1705.  *                          will be assigned to the dest parameter.
  1706.  *
  1707.  * Return status:
  1708.  *             JavaStatusOk : Operation completed normally.
  1709.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1710.  */
  1711.  
  1712. JavaStatus
  1713. JavaRef_assign(JavaEnv env, JavaRef dest, JavaRef src);
  1714.  
  1715. /*
  1716.  * Function:    JavaRef_isSameObject
  1717.  *
  1718.  * Description:
  1719.  *                Compares the identity of two Java objects.
  1720.  *
  1721.  * Parameters:
  1722.  *                    env    : The execution environment.
  1723.  *
  1724.  *                     r1 : A reference to test.
  1725.  *
  1726.  *                     r2 : The other reference to test.
  1727.  *
  1728.  * Return status:
  1729.  *                 JavaTrue : The references referred to the same object.
  1730.  *                JavaFalse : The references didn't refer to the same object.
  1731.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1732.  */
  1733.  
  1734. JavaStatus
  1735. JavaRef_isSameObject(JavaEnv env, JavaRef dest, JavaRef src);
  1736.  
  1737. /*
  1738.  * Function:    JavaRef_isArray
  1739.  *
  1740.  * Description:
  1741.  *                Used to tell if a specified reference points to an
  1742.  *                array object.
  1743.  *
  1744.  * Parameters:
  1745.  *                    env    : The execution environment.
  1746.  *
  1747.  *                    ref : The reference to test.
  1748.  *
  1749.  * Return value:
  1750.  *                 JavaTrue : The reference is to an array object.
  1751.  *                JavaFalse : The reference points to something else.
  1752.  */
  1753.  
  1754. JavaStatus
  1755. JavaRef_isArray(JavaEnv env, JavaRef ref);
  1756.  
  1757. /*
  1758.  * Function:    JavaRef_isObject
  1759.  *
  1760.  * Description:
  1761.  *                Used to tell if a specified reference points to an
  1762.  *                object.
  1763.  *
  1764.  * Parameters:
  1765.  *                    env    : The execution environment.
  1766.  *
  1767.  *                    ref : The reference to test.
  1768.  *
  1769.  * Return value:
  1770.  *                 JavaTrue : The reference is to an object.
  1771.  *                JavaFalse : The reference points to something else.
  1772.  */
  1773.  
  1774. JavaStatus
  1775. JavaRef_isObject(JavaEnv env, JavaRef ref);
  1776.  
  1777. /*
  1778.  * Function:    JavaRef_isClass
  1779.  *
  1780.  * Description:
  1781.  *                Used to tell if a specified reference points to a
  1782.  *                class object.
  1783.  *
  1784.  * Parameters:
  1785.  *                    env    : The execution environment.
  1786.  *
  1787.  *                    ref : The reference to test.
  1788.  *
  1789.  * Return value:
  1790.  *                 JavaTrue : The reference is to a class object.
  1791.  *                JavaFalse : The reference points to something else.
  1792.  */
  1793.  
  1794. JavaStatus
  1795. JavaRef_isClass(JavaEnv env, JavaRef ref);
  1796.  
  1797. /*
  1798.  * Function:    JavaObject_make
  1799.  *
  1800.  * Description:
  1801.  *                Constructs a new Java object, returning a reference
  1802.  *                to it. References to objects may be disposed via the
  1803.  *                JavaRef_disposeGlobal() operation although this does
  1804.  *                not destroy the object directly but rather allows them
  1805.  *                to be garbage collected.
  1806.  *
  1807.  * Parameters:
  1808.  *                    env    : The execution environment.
  1809.  *
  1810.  *                 result : § The newly constructed object. Specifying a
  1811.  *                          NULL pointer indicates that the result is not
  1812.  *                          desired.
  1813.  *
  1814.  *               classRef : The class object which defines the static
  1815.  *                          method. Class objects may be obtained by
  1816.  *                          the JavaRuntime_findClass() operation.
  1817.  *
  1818.  *         constructorSig : The signature of the constructor method to
  1819.  *                          invoke. The signature is used to determine
  1820.  *                          the number and type of any optional parameters
  1821.  *                          which follow it.
  1822.  *
  1823.  *                    ... : Any other parameters to be passed to the
  1824.  *                          method according to its signature.
  1825.  *
  1826.  * Return status:
  1827.  *             JavaStatusOk : Operation completed normally.
  1828.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1829.  *       JavaStatusNotFound : The desired method was not found in the class.
  1830.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  1831.  *                            according to the method's signature.
  1832.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  1833.  *                               exception can be obtaind by calling
  1834.  *                               JavaEnv_exceptionOccurred().
  1835.  */
  1836.  
  1837. JavaStatus
  1838. JavaObject_make(JavaEnv env, JavaRef *result,
  1839.     JavaRef classRef, char *constructorSig, ...);
  1840.  
  1841. JavaStatus
  1842. JavaObject_makeUTF(JavaEnv env, JavaRef *result,
  1843.     char *className, char *constructorSig, ...);
  1844.  
  1845. /*
  1846.  * Function:    JavaArray_make
  1847.  *
  1848.  * Description:
  1849.  *                Constructs a new Java array, returning a reference
  1850.  *                to it. References to arrays may be disposed via the
  1851.  *                JavaRef_disposeGlobal() operation although this does
  1852.  *                not destroy the object directly but rather allows them
  1853.  *                to be garbage collected.
  1854.  *
  1855.  * Parameters:
  1856.  *                    env    : The execution environment.
  1857.  *
  1858.  *                 result : § The newly constructed object. Specifying a
  1859.  *                          NULL pointer indicates that the result is not
  1860.  *                          desired.
  1861.  *
  1862.  *               classRef : The class object which defines the static
  1863.  *                          method. Class objects may be obtained by
  1864.  *                          the JavaRuntime_findClass() operation.
  1865.  *
  1866.  * Return status:
  1867.  *             JavaStatusOk : Operation completed normally.
  1868.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1869.  *       JavaStatusNotFound : The desired method was not found in the class.
  1870.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  1871.  *                            according to the method's signature.
  1872.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  1873.  *                               exception can be obtaind by calling
  1874.  *                               JavaEnv_exceptionOccurred().
  1875.  */
  1876.  
  1877. JavaStatus
  1878. JavaArray_make(JavaEnv env, JavaRef *result,
  1879.     JavaRef classRef, long length);
  1880.  
  1881. /*
  1882.  * Function:    JavaArray_makeUTF
  1883.  *
  1884.  * Description:
  1885.  *                Identical to JavaArray_make except it takes an array of characters
  1886.  *                and converts them to an array of Unicode (UTF) characters on the
  1887.  *                runtime side.
  1888.  *
  1889.  * Parameters:
  1890.  *                    env    : The execution environment.
  1891.  *
  1892.  *                 result : § The newly constructed array. Specifying a
  1893.  *                          NULL pointer indicates that the result is not
  1894.  *                          desired.
  1895.  *
  1896.  *              className : String name of the class object that holds the static method.
  1897.  *
  1898.  * Return status:
  1899.  *             JavaStatusOk : Operation completed normally.
  1900.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1901.  *       JavaStatusNotFound : The desired method was not found in the class.
  1902.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  1903.  *                            according to the method's signature.
  1904.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  1905.  *                               exception can be obtaind by calling
  1906.  *                               JavaEnv_exceptionOccurred().
  1907.  */
  1908.  
  1909. JavaStatus
  1910. JavaArray_makeUTF(JavaEnv env, JavaRef *result,
  1911.     char *className, long length);
  1912.  
  1913. /*
  1914.  * Function:    JavaObject_getClass
  1915.  *
  1916.  * Description:
  1917.  *                Returns the class of an object.
  1918.  *
  1919.  * Parameters:
  1920.  *                    env    : The execution environment.
  1921.  *
  1922.  *                    obj : The object which class should be returned.
  1923.  *
  1924.  * Return status:
  1925.  *              [reference] : The class of the object.
  1926.  *                 JavaNull : The class could not be returned (presumably
  1927.  *                            because the reference was invalid or null).
  1928.  */
  1929.  
  1930. JavaRef
  1931. JavaObject_getClass(JavaEnv env, JavaRef obj);
  1932.  
  1933. /*
  1934.  * Function:    JavaObject_print
  1935.  *
  1936.  * Description:
  1937.  *                Prints an object to an output file pointer. The
  1938.  *                printed representation is not necessarily rereadable
  1939.  *                by Java, but may be displayed to users to give some
  1940.  *                indication of which object is in question.
  1941.  *
  1942.  * Parameters:
  1943.  *                    env    : The execution environment.
  1944.  *
  1945.  *                    obj : The object to print.
  1946.  *
  1947.  *                    out : The file pointer to which to print.
  1948.  */
  1949.  
  1950. void
  1951. JavaObject_print(JavaEnv env, JavaRef obj, FILE *out);
  1952.  
  1953. /*
  1954.  * Function:    JavaObject_getFieldByName
  1955.  *
  1956.  * Description:
  1957.  *                Accesses a field of an object using an UTF string
  1958.  *                for the field's name.
  1959.  *
  1960.  * Parameters:
  1961.  *                    env    : The execution environment.
  1962.  *
  1963.  *                    obj : The object whose field to be accessed.
  1964.  *
  1965.  *              fieldName : A NULL-terminated UTF string specifying
  1966.  *                          the name of the field.
  1967.  *
  1968.  *                 result : § The returned field value.
  1969.  *
  1970.  * Return status:
  1971.  *             JavaStatusOk : Operation completed normally.
  1972.  *     JavaStatusParamError : Some parameter was not a valid reference.
  1973.  *       JavaStatusNotFound : The field with the specified name was not
  1974.  *                            found in the object.
  1975.  */
  1976.  
  1977. JavaStatus
  1978. JavaObject_getFieldByName(JavaEnv env, JavaRef obj,
  1979.     char *fieldName, JavaRef *result);
  1980.  
  1981. /*
  1982.  * Function:    JavaObject_setFieldByName
  1983.  *
  1984.  * Description:
  1985.  *                Set a field of an object using a UTF string for
  1986.  *                the field's name.
  1987.  *
  1988.  * Parameters:
  1989.  *                    env    : The execution environment.
  1990.  *
  1991.  *                    obj : The object whose field to be accessed.
  1992.  *
  1993.  *              fieldName : A NULL-terminated UTF string specifying
  1994.  *                          the name of the field.
  1995.  *
  1996.  *                  value : The new value to store in the field.
  1997.  *
  1998.  * Return status:
  1999.  *             JavaStatusOk : Operation completed normally.
  2000.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2001.  *       JavaStatusNotFound : The field with the specified name was not
  2002.  *                            found in the object.
  2003.  *      JavaStatusTypeError : The value was not the appropriate type
  2004.  *                            for the field and consequently was not set.
  2005.  */
  2006.  
  2007. JavaStatus
  2008. JavaObject_setFieldByName(JavaEnv env, JavaRef obj,
  2009.     char *fieldName, JavaRef value);
  2010.  
  2011. /*
  2012.  * Function:    JavaObject_getField
  2013.  *
  2014.  * Description:
  2015.  *                Accesses a field of an object by index.
  2016.  *
  2017.  * Parameters:
  2018.  *                    env    : The execution environment.
  2019.  *
  2020.  *                    obj : The object whose field to be accessed.
  2021.  *
  2022.  *                  index : The index of the field to access.
  2023.  *
  2024.  *                 result : § The returned field value.
  2025.  *
  2026.  * Return status:
  2027.  *             JavaStatusOk : Operation completed normally.
  2028.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2029.  *       JavaStatusNotFound : The field with the specified name was not
  2030.  *                            found in the object.
  2031.  */
  2032.  
  2033. JavaStatus
  2034. JavaObject_getField(JavaEnv env, JavaRef obj,
  2035.     size_t index, JavaRef *result);
  2036.  
  2037. /*
  2038.  * Function:    JavaObject_setField
  2039.  *
  2040.  * Description:
  2041.  *                Sets a field of an object by index.
  2042.  *
  2043.  * Parameters:
  2044.  *                    env    : The execution environment.
  2045.  *
  2046.  *                    obj : The object whose field to be accessed.
  2047.  *
  2048.  *                  index : The index of the field to access.
  2049.  *
  2050.  *                  value : The new value to store in the field.
  2051.  *
  2052.  * Return status:
  2053.  *             JavaStatusOk : Operation completed normally.
  2054.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2055.  *       JavaStatusNotFound : The field with the specified name was not
  2056.  *                            found in the object.
  2057.  *      JavaStatusTypeError : The value was not the appropriate type
  2058.  *                            for the field and consequently was not set.
  2059.  */
  2060.  
  2061. JavaStatus
  2062. JavaObject_setField(JavaEnv env, JavaRef obj,
  2063.     size_t index, JavaRef value);
  2064.  
  2065. /*
  2066.  * Function:    JavaObject_getField_boolean
  2067.  *                JavaObject_getField_byte
  2068.  *                JavaObject_getField_char
  2069.  *                JavaObject_getField_short
  2070.  *                JavaObject_getField_int
  2071.  *                JavaObject_getField_long
  2072.  *                JavaObject_getField_float
  2073.  *                JavaObject_getField_double
  2074.  *
  2075.  * Description:
  2076.  *                Accesses a field of an object by index.
  2077.  *
  2078.  * Parameters:
  2079.  *                    env    : The execution environment.
  2080.  *
  2081.  *                    obj : The object whose field to be accessed.
  2082.  *
  2083.  *                  index : The index of the field to access.
  2084.  *
  2085.  *                 result : § The returned field value.
  2086.  *
  2087.  * Return status:
  2088.  *             JavaStatusOk : Operation completed normally.
  2089.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2090.  *       JavaStatusNotFound : The field with the specified name was not
  2091.  *                            found in the object.
  2092.  */
  2093.  
  2094. JavaStatus
  2095. JavaObject_getField_boolean(JavaEnv env, JavaRef obj,
  2096.     size_t index, JavaBoolean *result);
  2097.  
  2098. JavaStatus
  2099. JavaObject_getField_byte(JavaEnv env, JavaRef obj,
  2100.     size_t index, JavaByte *result);
  2101.  
  2102. JavaStatus
  2103. JavaObject_getField_char(JavaEnv env, JavaRef obj,
  2104.     size_t index, JavaChar *result);
  2105.  
  2106. JavaStatus
  2107. JavaObject_getField_short(JavaEnv env, JavaRef obj,
  2108.     size_t index, JavaShort *result);
  2109.  
  2110. JavaStatus
  2111. JavaObject_getField_int(JavaEnv env, JavaRef obj,
  2112.     size_t index, JavaInt *result);
  2113.  
  2114. JavaStatus
  2115. JavaObject_getField_long(JavaEnv env, JavaRef obj,
  2116.     size_t index, JavaLong *result);
  2117.  
  2118. JavaStatus
  2119. JavaObject_getField_float(JavaEnv env, JavaRef obj,
  2120.     size_t index, JavaFloat *result);
  2121.  
  2122. JavaStatus
  2123. JavaObject_getField_double(JavaEnv env, JavaRef obj,
  2124.     size_t index, JavaDouble *result);
  2125.  
  2126. /*
  2127.  * Function:    JavaObject_getFieldByName_boolean
  2128.  *                JavaObject_getFieldByName_byte
  2129.  *                JavaObject_getFieldByName_char
  2130.  *                JavaObject_getFieldByName_short
  2131.  *                JavaObject_getFieldByName_int
  2132.  *                JavaObject_getFieldByName_long
  2133.  *                JavaObject_getFieldByName_float
  2134.  *                JavaObject_getFieldByName_double
  2135.  *
  2136.  * Description:
  2137.  *                Accesses a field of an object by name.
  2138.  *
  2139.  * Parameters:
  2140.  *                    env    : The execution environment.
  2141.  *
  2142.  *                    obj : The object whose field to be accessed.
  2143.  *
  2144.  *                  index : The index of the field to access.
  2145.  *
  2146.  *                 result : § The returned field value.
  2147.  *
  2148.  * Return status:
  2149.  *             JavaStatusOk : Operation completed normally.
  2150.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2151.  *      JavaStatusTypeError : The field was not of appropriate type.
  2152.  *       JavaStatusNotFound : The field with the specified name was not
  2153.  *                            found in the object.
  2154.  */
  2155.  
  2156. JavaStatus
  2157. JavaObject_getFieldByName_boolean(JavaEnv env, JavaRef obj,
  2158.     char *fieldName, JavaBoolean *result);
  2159.  
  2160. JavaStatus
  2161. JavaObject_getFieldByName_byte(JavaEnv env, JavaRef obj,
  2162.     char *fieldName, JavaByte *result);
  2163.  
  2164. JavaStatus
  2165. JavaObject_getFieldByName_char(JavaEnv env, JavaRef obj,
  2166.     char *fieldName, JavaChar *result);
  2167.  
  2168. JavaStatus
  2169. JavaObject_getFieldByName_short(JavaEnv env, JavaRef obj,
  2170.     char *fieldName, JavaShort *result);
  2171.  
  2172. JavaStatus
  2173. JavaObject_getFieldByName_int(JavaEnv env, JavaRef obj,
  2174.     char *fieldName, JavaInt *result);
  2175.  
  2176. JavaStatus
  2177. JavaObject_getFieldByName_long(JavaEnv env, JavaRef obj,
  2178.     char *fieldName, JavaLong *result);
  2179.  
  2180. JavaStatus
  2181. JavaObject_getFieldByName_float(JavaEnv env, JavaRef obj,
  2182.     char *fieldName, JavaFloat *result);
  2183.  
  2184. JavaStatus
  2185. JavaObject_getFieldByName_double(JavaEnv env, JavaRef obj,
  2186.     char *fieldName, JavaDouble *result);
  2187.  
  2188. /*
  2189.  * Function:    JavaObject_setField_boolean
  2190.  *                JavaObject_setField_byte
  2191.  *                JavaObject_setField_char
  2192.  *                JavaObject_setField_short
  2193.  *                JavaObject_setField_int
  2194.  *                JavaObject_setField_long
  2195.  *                JavaObject_setField_float
  2196.  *                JavaObject_setField_double
  2197.  *
  2198.  * Description:
  2199.  *                Sets a field of an object by index.
  2200.  *
  2201.  * Parameters:
  2202.  *                    env    : The execution environment.
  2203.  *
  2204.  *                    obj : The object whose field to be accessed.
  2205.  *
  2206.  *                  index : The index of the field to access.
  2207.  *
  2208.  *                  value : The new value to store in the field.
  2209.  *
  2210.  * Return status:
  2211.  *             JavaStatusOk : Operation completed normally.
  2212.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2213.  *       JavaStatusNotFound : The field with the specified name was not
  2214.  *                            found in the object.
  2215.  *      JavaStatusTypeError : The value was not the appropriate type
  2216.  *                            for the field and consequently was not set.
  2217.  */
  2218.  
  2219. JavaStatus
  2220. JavaObject_setField_boolean(JavaEnv env, JavaRef obj,
  2221.     size_t index, JavaBoolean value);
  2222.  
  2223. JavaStatus
  2224. JavaObject_setField_byte(JavaEnv env, JavaRef obj,
  2225.     size_t index, JavaByte value);
  2226.  
  2227. JavaStatus
  2228. JavaObject_setField_char(JavaEnv env, JavaRef obj,
  2229.     size_t index, JavaChar value);
  2230.  
  2231. JavaStatus
  2232. JavaObject_setField_short(JavaEnv env, JavaRef obj,
  2233.     size_t index, JavaShort value);
  2234.  
  2235. JavaStatus
  2236. JavaObject_setField_int(JavaEnv env, JavaRef obj,
  2237.     size_t index, JavaInt value);
  2238.  
  2239. JavaStatus
  2240. JavaObject_setField_long(JavaEnv env, JavaRef obj,
  2241.     size_t index, JavaLong value);
  2242.  
  2243. JavaStatus
  2244. JavaObject_setField_float(JavaEnv env, JavaRef obj,
  2245.     size_t index, JavaFloat value);
  2246.  
  2247. JavaStatus
  2248. JavaObject_setField_double(JavaEnv env, JavaRef obj,
  2249.     size_t index, JavaDouble value);
  2250.  
  2251. /*
  2252.  * Function:    JavaObject_setFieldByName_boolean
  2253.  *                JavaObject_setFieldByName_byte
  2254.  *                JavaObject_setFieldByName_char
  2255.  *                JavaObject_setFieldByName_short
  2256.  *                JavaObject_setFieldByName_int
  2257.  *                JavaObject_setFieldByName_long
  2258.  *                JavaObject_setFieldByName_float
  2259.  *                JavaObject_setFieldByName_double
  2260.  *
  2261.  * Description:
  2262.  *                Sets a field of an object by name.
  2263.  *
  2264.  * Parameters:
  2265.  *                    env    : The execution environment.
  2266.  *
  2267.  *                    obj : The object whose field to be accessed.
  2268.  *
  2269.  *                  index : The index of the field to access.
  2270.  *
  2271.  *                  value : The new value to store in the field.
  2272.  *
  2273.  * Return status:
  2274.  *             JavaStatusOk : Operation completed normally.
  2275.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2276.  *       JavaStatusNotFound : The field with the specified name was not
  2277.  *                            found in the object.
  2278.  *      JavaStatusTypeError : The value was not the appropriate type
  2279.  *                            for the field and consequently was not set.
  2280.  */
  2281.  
  2282. JavaStatus
  2283. JavaObject_setFieldByName_boolean(JavaEnv env, JavaRef obj,
  2284.     char *fieldName, JavaBoolean value);
  2285.  
  2286. JavaStatus
  2287. JavaObject_setFieldByName_byte(JavaEnv env, JavaRef obj,
  2288.     char *fieldName, JavaByte value);
  2289.  
  2290. JavaStatus
  2291. JavaObject_setFieldByName_char(JavaEnv env, JavaRef obj,
  2292.     char *fieldName, JavaChar value);
  2293.  
  2294. JavaStatus
  2295. JavaObject_setFieldByName_short(JavaEnv env, JavaRef obj,
  2296.     char *fieldName, JavaShort value);
  2297.  
  2298. JavaStatus
  2299. JavaObject_setFieldByName_int(JavaEnv env, JavaRef obj,
  2300.     char *fieldName, JavaInt value);
  2301.  
  2302. JavaStatus
  2303. JavaObject_setFieldByName_long(JavaEnv env, JavaRef obj,
  2304.     char *fieldName, JavaLong value);
  2305.  
  2306. JavaStatus
  2307. JavaObject_setFieldByName_float(JavaEnv env, JavaRef obj,
  2308.     char *fieldName, JavaFloat value);
  2309.  
  2310. JavaStatus
  2311. JavaObject_setFieldByName_double(JavaEnv env, JavaRef obj,
  2312.     char *fieldName, JavaDouble value);
  2313.  
  2314. /*
  2315.  * Function:    JavaObject_call
  2316.  *
  2317.  * Description:
  2318.  *                Invokes a (dynamic) method on a Java object.
  2319.  *                The method is looked up in the context of the
  2320.  *                object's class according to the specified name
  2321.  *                and signature.
  2322.  *
  2323.  * Parameters:
  2324.  *                    env    : The execution environment.
  2325.  *
  2326.  *                 result : § Any result value that the method
  2327.  *                          returned. If the method has a void
  2328.  *                          result type, NULL will be returned.
  2329.  *                          Specifying a NULL pointer indicates
  2330.  *                          that the result is not desired.
  2331.  *
  2332.  *                    obj : The object to invoke the method against.
  2333.  *                          This object becomes the 'this' parameter
  2334.  *                          of the method.
  2335.  *
  2336.  *             methodName : The name of the method to invoke.
  2337.  *
  2338.  *              methodSig : The signature of the method to invoke.
  2339.  *                          The signature is used to determine the
  2340.  *                          number and type of any optional parameters
  2341.  *                          which follow it.
  2342.  *
  2343.  *                    ... : Any other parameters to be passed to the
  2344.  *                          method according to its signature.
  2345.  *
  2346.  * Return status:
  2347.  *             JavaStatusOk : Operation completed normally.
  2348.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2349.  *       JavaStatusNotFound : The desired method was not found in the class.
  2350.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  2351.  *                            according to the method's signature.
  2352.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  2353.  *                               exception can be obtaind by calling
  2354.  *                               JavaEnv_exceptionOccurred().
  2355.  */
  2356.  
  2357. JavaStatus
  2358. JavaObject_call(JavaEnv env, void *result,
  2359.     JavaRef obj, char *methodName, char *methodSig, ...);
  2360.  
  2361. JavaStatus
  2362. JavaObject_vcall(JavaEnv env, void *result,
  2363.     JavaRef obj, char *methodName, char *methodSig, va_list args);
  2364.  
  2365. /*
  2366.  * Function:    JavaObject_callStatic
  2367.  *
  2368.  * Description:
  2369.  *                Invokes a static method on a Java object.
  2370.  *                The method is looked up in the context of the
  2371.  *                class according to the specified name and
  2372.  *                signature.
  2373.  *
  2374.  * Parameters:
  2375.  *                    env    : The execution environment.
  2376.  *
  2377.  *                 result : § Any result value that the method
  2378.  *                          returned. If the method has a void
  2379.  *                          result type, NULL will be returned.
  2380.  *                          Specifying a NULL pointer indicates
  2381.  *                          that the result is not desired.
  2382.  *
  2383.  *               classRef : The class object which defines the
  2384.  *                          static method. Class objects may be
  2385.  *                          obtained by the JavaRuntime_findClass()
  2386.  *                          operation.
  2387.  *
  2388.  *             methodName : The name of the method to invoke.
  2389.  *
  2390.  *              methodSig : The signature of the method to invoke.
  2391.  *                          The signature is used to determine the
  2392.  *                          number and type of any optional parameters
  2393.  *                          which follow it.
  2394.  *
  2395.  *                    ... : Any other parameters to be passed to the
  2396.  *                          method according to its signature.
  2397.  *
  2398.  * Return status:
  2399.  *             JavaStatusOk : Operation completed normally.
  2400.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2401.  *       JavaStatusNotFound : The desired method was not found in the class.
  2402.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  2403.  *                            according to the method's signature.
  2404.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  2405.  *                               exception can be obtaind by calling
  2406.  *                               JavaEnv_exceptionOccurred().
  2407.  */
  2408.  
  2409. JavaStatus
  2410. JavaObject_callStatic(JavaEnv env, void *result,
  2411.     JavaRef classRef, char *methodName, char *methodSig, ...);
  2412.  
  2413. JavaStatus
  2414. JavaObject_vcallStatic(JavaEnv env, void *result,
  2415.     JavaRef classRef, char *methodName, char *methodSig, va_list args);
  2416.  
  2417. JavaStatus
  2418. JavaObject_callStaticUTF(JavaEnv env, void *result,
  2419.     char *className, char *methodName, char *methodSig, ...);
  2420.  
  2421. JavaStatus
  2422. JavaObject_vcallStaticUTF(JavaEnv env, void *result,
  2423.     char *className, char *methodName, char *methodSig, va_list args);
  2424.  
  2425. /*
  2426.  * Function:    JavaObject_fork
  2427.  *                JavaObject_forkUTF
  2428.  *
  2429.  * Description:
  2430.  *                Invokes 'main' on a Java class in a new
  2431.  *                thread.
  2432.  *
  2433.  * Parameters:
  2434.  *                    env    : The execution environment.
  2435.  *
  2436.  *                 result : § Any result value that the method
  2437.  *                          returned. If the method has a void
  2438.  *                          result type, NULL will be returned.
  2439.  *                          Specifying a NULL pointer indicates
  2440.  *                          that the result is not desired.
  2441.  *
  2442.  *               classRef : The class object which defines the
  2443.  *                          static method. Class objects may be
  2444.  *                          obtained by the JavaRuntime_findClass()
  2445.  *                          operation.
  2446.  *
  2447.  * Return status:
  2448.  *             JavaStatusOk : Operation completed normally.
  2449.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2450.  *       JavaStatusNotFound : The desired method was not found in the class.
  2451.  *      JavaStatusTypeError : Some parameter was not the appropriate type
  2452.  *                            according to the method's signature.
  2453.  *  JavaStatusExceptionThrow : An exception was thrown by Java. The
  2454.  *                               exception can be obtaind by calling
  2455.  *                               JavaEnv_exceptionOccurred().
  2456.  */
  2457.  
  2458. JavaStatus
  2459. JavaObject_fork(JavaEnv env, JavaRef *result,
  2460.     JavaRef classRef, size_t argc, char **argv);
  2461.  
  2462. JavaStatus
  2463. JavaObject_forkUTF(JavaEnv env, JavaRef *result,
  2464.     char *className, size_t argc, char **argv);
  2465.  
  2466. /*
  2467.  * Function:    JavaObject_hashCode
  2468.  *
  2469.  * Description:
  2470.  *                Returns the hash code for an object.
  2471.  *
  2472.  * Parameters:
  2473.  *                    env    : The execution environment.
  2474.  *
  2475.  *                    obj : The object which a hash code should be returned.
  2476.  *
  2477.  *                 result : § The returned hash code value.
  2478.  *
  2479.  * Return status:
  2480.  *             JavaStatusOk : Operation completed normally.
  2481.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2482.  */
  2483.  
  2484. JavaStatus
  2485. JavaObject_hashCode(JavaEnv env, JavaRef obj, JavaInt *result);
  2486.  
  2487. /*
  2488.  * Function:    JavaObject_clone
  2489.  *
  2490.  * Description:    
  2491.  *                Returns a copy of the 'obj' parameter in the 'result'.
  2492.  *
  2493.  * Parameters:
  2494.  *                    env    : The execution environment.
  2495.  *
  2496.  *                    obj : The object to be copied
  2497.  *
  2498.  *                 result : The new object that was created.
  2499.  *
  2500.  * Return status:
  2501.  *             JavaStatusOk : Operation completed normally.
  2502.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2503.  */
  2504.  
  2505. JavaStatus
  2506. JavaObject_clone(JavaEnv env, JavaRef obj, JavaRef *result);
  2507.  
  2508. /*
  2509.  * Function:    JavaObject_notify
  2510.  *
  2511.  * Description:
  2512.  *                Notifies the runtime that a resource has been unlocked.
  2513.  *                This will wake up the next thread blocked on the object.
  2514.  *
  2515.  * Parameters:
  2516.  *                    env    : The execution environment.
  2517.  *
  2518.  *                    obj : The object which one or many threads are blocked on.
  2519.  *
  2520.  * Return status:
  2521.  *             JavaStatusOk : Operation completed normally.
  2522.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2523.  */
  2524.  
  2525. JavaStatus
  2526. JavaObject_notify(JavaEnv env, JavaRef obj);
  2527.  
  2528. /*
  2529.  * Function:    JavaObject_notifyAll
  2530.  *
  2531.  * Description:
  2532.  *                Wakes up all threads blocked on the object pointed to in 'obj'.
  2533.  *
  2534.  * Parameters:
  2535.  *                    env    : The execution environment.
  2536.  *
  2537.  *                    obj : The object on which one or many threads are blocked.
  2538.  *
  2539.  * Return status:
  2540.  *             JavaStatusOk : Operation completed normally.
  2541.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2542.  */
  2543.  
  2544. JavaStatus
  2545. JavaObject_notifyAll(JavaEnv env, JavaRef obj);
  2546.  
  2547. /*
  2548.  * Function:    JavaObject_wait
  2549.  *
  2550.  * Description:
  2551.  *                Causes the current thread to block on access to an object.
  2552.  *
  2553.  * Parameters:
  2554.  *                    env    : The execution environment.
  2555.  *
  2556.  *                    obj : The object on which the thread is waiting for access.
  2557.  *
  2558.  *                timeout : Max num of milliseconds we want to wait.
  2559.  *
  2560.  * Return status:
  2561.  *             JavaStatusOk : Operation completed normally.
  2562.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2563.  */
  2564.  
  2565. JavaStatus
  2566. JavaObject_wait(JavaEnv env, JavaRef obj, JavaLong delay);
  2567.  
  2568. /*
  2569.  * Function:    JavaClass_getName
  2570.  *
  2571.  * Description:
  2572.  *                Get the name of the current class.  Returns a C string.
  2573.  *
  2574.  * Parameters:
  2575.  *                    env    : The execution environment.
  2576.  *
  2577.  *               classRef : The class to get the name for.
  2578.  *
  2579.  *              className : § The class name. Copy this name if you
  2580.  *                          want to use it for anything except a quick
  2581.  *                          string compare. The class can be unloaded
  2582.  *                          and moved around at any given time.
  2583.  *
  2584.  * Return status:
  2585.  *             JavaStatusOk : Operation completed normally.
  2586.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2587.  */
  2588.  
  2589. JavaStatus
  2590. JavaClass_getName(JavaEnv env, JavaRef classRef, char **className);
  2591.  
  2592. /*
  2593.  * Function:    JavaClass_verify
  2594.  *
  2595.  * Description:
  2596.  *                Verifies that a class objct does not violate the
  2597.  *                access restrictions of other classes it references.
  2598.  *                It is recommended that this operation be invoked
  2599.  *                after loading a class from an untrusted source.
  2600.  *
  2601.  * Parameters:
  2602.  *                    env    : The execution environment.
  2603.  *
  2604.  *               classRef : The class to verify.
  2605.  *
  2606.  * Return status:
  2607.  *                 JavaTrue : The class was verified to be a valid class.
  2608.  *                JavaFalse : The class failed to be verified.
  2609.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2610.  *      JavaStatusTypeError : The class parameter did not specify a valid
  2611.  *                            class object.
  2612.  */
  2613.  
  2614. JavaStatus
  2615. JavaClass_verify(JavaEnv env, JavaRef classRef);
  2616.  
  2617. /*
  2618.  * Function:    JavaClass_getSuperclass
  2619.  *
  2620.  * Description:
  2621.  *                Returns the direct superclass of a class. If the class
  2622.  *                Object is passed or an instance which is not a class,
  2623.  *                JavaNull is returned.
  2624.  *
  2625.  * Parameters:
  2626.  *                    env    : The execution environment.
  2627.  *
  2628.  *               classRef : The class whose superclass is required. An
  2629.  *                          actual reference to a class object may be
  2630.  *                          passed, or one of the special JavaRefConstant
  2631.  *                          values.
  2632.  *
  2633.  * Return value:
  2634.  *              [reference] : The super class of the specified class.
  2635.  *                 JavaNull : The class Object was passed or an instance
  2636.  *                            which is not a class.
  2637.  */
  2638.  
  2639. JavaRef
  2640. JavaClass_getSuperclass(JavaEnv env, JavaRef classRef);
  2641.  
  2642. /*
  2643.  * Function:    JavaClass_getClassLoader
  2644.  *
  2645.  * Description:
  2646.  *                Returns a reference to the class loader that created
  2647.  *                this class. JavaNull is returned for system classes.
  2648.  *
  2649.  * Parameters:
  2650.  *                    env    : The execution environment.
  2651.  *
  2652.  *               classRef : The class whose class loader is required. An
  2653.  *                          actual reference to a class object may be
  2654.  *                          passed, or one of the special JavaRefConstant
  2655.  *                          values.
  2656.  *
  2657.  * Return value:
  2658.  *              [reference] : The class loader of the specified class.
  2659.  *                 JavaNull : The class Object was a system class.
  2660.  */
  2661.  
  2662. JavaRef
  2663. JavaClass_getClassLoader(JavaEnv env, JavaRef classRef);
  2664.  
  2665. /*
  2666.  * Function:    JavaClass_getInterfaceCount
  2667.  *
  2668.  * Description:
  2669.  *                Returns the number of interfaces of the class.
  2670.  *
  2671.  * Parameters:
  2672.  *                    env    : The execution environment.
  2673.  *
  2674.  *               classRef : The class whose interfaces are required. An
  2675.  *                          actual reference to a class object may be
  2676.  *                          passed, or one of the special JavaRefConstant
  2677.  *                          values.
  2678.  *
  2679.  * Return value:
  2680.  *               [size_t] : The number of interfaces of the class. If
  2681.  *                          the class parameter did not specify a valid
  2682.  *                          class, 0 is returned.
  2683.  */
  2684.  
  2685. size_t
  2686. JavaClass_getInterfaceCount(JavaEnv env, JavaRef classRef);
  2687.  
  2688. /*
  2689.  * Function:    JavaClass_getInterface
  2690.  *
  2691.  * Description:
  2692.  *                Returns the indexed interface of the class.
  2693.  *
  2694.  * Parameters:
  2695.  *                    env    : The execution environment.
  2696.  *
  2697.  *               classRef : The class whose interface is required. An
  2698.  *                          actual reference to a class object may be
  2699.  *                          passed, or one of the special JavaRefConstant
  2700.  *                          values.
  2701.  *
  2702.  *         interfaceIndex : The index of the interface to return.
  2703.  *
  2704.  *              interface : § The returned interface reference.
  2705.  *
  2706.  * Return value:
  2707.  *             JavaStatusOk : Operation completed normally.
  2708.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2709.  *       JavaStatusNotFound : The interface with the specified index was
  2710.  *                            not found in the class.
  2711.  */
  2712.  
  2713. JavaStatus
  2714. JavaClass_getInterface(JavaEnv env, JavaRef classRef,
  2715.     size_t interfaceIndex, JavaRef *interface);
  2716.  
  2717. /*
  2718.  * Function:    JavaClass_implementsInterface
  2719.  *
  2720.  * Description:
  2721.  *                Determines whether a class implements an interface.
  2722.  *
  2723.  * Parameters:
  2724.  *                    env    : The execution environment.
  2725.  *
  2726.  *               classRef : The class object which is to be tested to
  2727.  *                          determine whether it implements the interface.
  2728.  *                          An actual reference to a class object may be
  2729.  *                          passed, or one of the special JavaRefConstant
  2730.  *                          values.
  2731.  *
  2732.  *              interface : The interface object to test.
  2733.  *
  2734.  * Return value:
  2735.  *             JavaStatusOk : Operation completed normally.
  2736.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2737.  *      JavaStatusTypeError : The class parameter did not specify a class
  2738.  *                            object.
  2739.  */
  2740.  
  2741. JavaStatus
  2742. JavaClass_implementsInterface(JavaEnv env, JavaRef classRef, JavaRef interface);
  2743.  
  2744. /*
  2745.  * Function:    JavaClass_isInterface
  2746.  *
  2747.  * Description:
  2748.  *                Determines whether a class is an interface.
  2749.  *
  2750.  * Parameters:
  2751.  *                    env    : The execution environment.
  2752.  *
  2753.  *               classRef : The class object which is to be tested to
  2754.  *                          determine whether it implements the interface.
  2755.  *                          An actual reference to a class object may be
  2756.  *                          passed, or one of the special JavaRefConstant
  2757.  *                          values.
  2758.  *
  2759.  * Return value:
  2760.  *                 JavaTrue : The class is an interface.
  2761.  *                JavaFalse : The class is not an interface.
  2762.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2763.  *      JavaStatusTypeError : The class parameter did not specify a valid
  2764.  *                            class object.
  2765.  */
  2766.  
  2767. JavaStatus
  2768. JavaClass_isInterface(JavaEnv env, JavaRef classRef);
  2769.  
  2770. /*
  2771.  * Function:    JavaClass_getFieldInfoByName
  2772.  *
  2773.  * Description:
  2774.  *                Returns the index, signature, and access flags of a
  2775.  *                named field.
  2776.  *
  2777.  * Parameters:
  2778.  *                    env    : The execution environment.
  2779.  *
  2780.  *               classRef : The class of the objects whose field is to
  2781.  *                          be accessed.
  2782.  *
  2783.  *                  field : The identifier specifying the name of the
  2784.  *                          field.
  2785.  *
  2786.  *                  index : § The returned index of the field. Specifying
  2787.  *                          a NULL pointer indicates that the result is
  2788.  *                          not desired.
  2789.  *
  2790.  *              signature : § The returned signature of the field.
  2791.  *                          Specifying a NULL pointer indicates that
  2792.  *                          the result is not desired.
  2793.  *
  2794.  *                 access : § The returned access permission flag of the
  2795.  *                          field, e.g. whether it was public, private,
  2796.  *                          Specifying a NULL pointer indicates that
  2797.  *                          the result is not desired.
  2798.  *
  2799.  * Return value:
  2800.  *             JavaStatusOk : Operation completed normally.
  2801.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2802.  *      JavaStatusTypeError : The class parameter did not specify a class
  2803.  *                            object.
  2804.  */
  2805.  
  2806. JavaStatus
  2807. JavaClass_getFieldInfoByName(JavaEnv env, JavaRef classRef,
  2808.     char *field, size_t *index, char **signature,
  2809.     JavaAccessFlags *access);
  2810.  
  2811. /*
  2812.  * Function:    JavaClass_getFieldCount
  2813.  *
  2814.  * Description:
  2815.  *                Returns the number of fields defined directly by a
  2816.  *                class. This does not include any fields defined by
  2817.  *                its superclasses.
  2818.  *
  2819.  * Parameters:
  2820.  *                    env    : The execution environment.
  2821.  *
  2822.  *               classRef : The class whose interfaces are required. An
  2823.  *                          actual reference to a class object may be
  2824.  *                          passed, or one of the special JavaRefConstant
  2825.  *                          values.
  2826.  *
  2827.  * Return value:
  2828.  *               [size_t] : The number of fields defined directly by the
  2829.  *                          class. If the class parameter did not specify
  2830.  *                          a valid class, 0 is returned.
  2831.  */
  2832.  
  2833. size_t
  2834. JavaClass_getFieldCount(JavaEnv env, JavaRef classRef);
  2835.  
  2836. /*
  2837.  * Function:    JavaClass_getFieldInfo
  2838.  *
  2839.  * Description:
  2840.  *                Returns the name, signature, and access flags of a field
  2841.  *                specified by index.
  2842.  *
  2843.  * Parameters:
  2844.  *                    env    : The execution environment.
  2845.  *
  2846.  *               classRef : The class of the objects whose field is to
  2847.  *                          be accessed.
  2848.  *
  2849.  *                  index : The index of the field in the object.
  2850.  *
  2851.  *                   name : § The resulting identifier specifying the
  2852.  *                          name of the field. Specifying a NULL pointer
  2853.  *                          indicates that the rsult is not desired.
  2854.  *
  2855.  *              signature : § The returned signature of the field.
  2856.  *                          Specifying a NULL pointer indicates that
  2857.  *                          the result is not desired.
  2858.  *
  2859.  *                 access : § The returned access permission flag of the
  2860.  *                          field, e.g. whether it was public, private,
  2861.  *                          Specifying a NULL pointer indicates that
  2862.  *                          the result is not desired.
  2863.  *
  2864.  * Return value:
  2865.  *             JavaStatusOk : Operation completed normally.
  2866.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2867.  *      JavaStatusTypeError : The class parameter did not specify a class
  2868.  *                            object.
  2869.  */
  2870.  
  2871. JavaStatus
  2872. JavaClass_getFieldInfo(JavaEnv env, JavaRef classRef,size_t index,
  2873.     char **name, char **signature, JavaAccessFlags *access);
  2874.  
  2875. /*
  2876.  * Function:    JavaClass_getMethodCount
  2877.  *
  2878.  * Description:
  2879.  *                Returns the number of methods directly defined by a
  2880.  *                class .This does not include any methods defined by its
  2881.  *                superclasses, but does include both static and dynamic
  2882.  *                methods.
  2883.  *
  2884.  * Parameters:
  2885.  *                    env    : The execution environment.
  2886.  *
  2887.  *               classRef : The class object.
  2888.  *
  2889.  * Return value:
  2890.  *               [size_t] : The number of methods defined directly by the
  2891.  *                          class. If the class parameter did not specify
  2892.  *                          a valid class, 0 is returned.
  2893.  */
  2894.  
  2895. size_t
  2896. JavaClass_getMethodCount(JavaEnv env, JavaRef classRef);
  2897.  
  2898. /*
  2899.  * Function:    JavaClass_getMethodInfo
  2900.  *
  2901.  * Description:
  2902.  *                Returns the name, signature, and access flags of a method
  2903.  *                specified by index.
  2904.  *
  2905.  * Parameters:
  2906.  *                    env    : The execution environment.
  2907.  *
  2908.  *               classRef : The class of the objects whose method is to
  2909.  *                          be accessed.
  2910.  *
  2911.  *                  index : The index of the method in the object.
  2912.  *
  2913.  *                   name : § The resulting identifier specifying the
  2914.  *                          name of the method. Specifying a NULL pointer
  2915.  *                          indicates that the rsult is not desired.
  2916.  *
  2917.  *              signature : § The returned signature of the method.
  2918.  *                          Specifying a NULL pointer indicates that
  2919.  *                          the result is not desired.
  2920.  *
  2921.  *                 access : § The returned access permission flag of the
  2922.  *                          method, e.g. whether it was public, private,
  2923.  *                          Specifying a NULL pointer indicates that
  2924.  *                          the result is not desired.
  2925.  *
  2926.  * Return value:
  2927.  *             JavaStatusOk : Operation completed normally.
  2928.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2929.  *      JavaStatusTypeError : The class parameter did not specify a class
  2930.  *                            object.
  2931.  */
  2932.  
  2933. JavaStatus
  2934. JavaClass_getMethodInfo(JavaEnv env, JavaRef classRef,size_t index,
  2935.     char **name, char **signature, JavaAccessFlags *access);
  2936.  
  2937. /*
  2938.  * Function:    JavaClass_getFieldByName
  2939.  *
  2940.  * Description:
  2941.  *                Accesses a field of a class using an UTF string
  2942.  *                for the field's name.
  2943.  *
  2944.  * Parameters:
  2945.  *                    env    : The execution environment.
  2946.  *
  2947.  *               classRef : The class whose field to be accessed.
  2948.  *
  2949.  *              fieldName : A NULL-terminated UTF string specifying
  2950.  *                          the name of the field.
  2951.  *
  2952.  *                 result : § The returned field value.
  2953.  *
  2954.  * Return status:
  2955.  *             JavaStatusOk : Operation completed normally.
  2956.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2957.  *       JavaStatusNotFound : The field with the specified name was not
  2958.  *                            found in the class.
  2959.  */
  2960.  
  2961. JavaStatus
  2962. JavaClass_getFieldByName(JavaEnv env, JavaRef classRef,
  2963.     char *fieldName, JavaRef *result);
  2964.  
  2965. /*
  2966.  * Function:    JavaClass_setFieldByName
  2967.  *
  2968.  * Description:
  2969.  *                Set a field of a class using a UTF string for
  2970.  *                the field's name.
  2971.  *
  2972.  * Parameters:
  2973.  *                    env    : The execution environment.
  2974.  *
  2975.  *               classRef : The class whose field to be accessed.
  2976.  *
  2977.  *              fieldName : A NULL-terminated UTF string specifying
  2978.  *                          the name of the field.
  2979.  *
  2980.  *                  value : The new value to store in the field.
  2981.  *
  2982.  * Return status:
  2983.  *             JavaStatusOk : Operation completed normally.
  2984.  *     JavaStatusParamError : Some parameter was not a valid reference.
  2985.  *       JavaStatusNotFound : The field with the specified name was not
  2986.  *                            found in the class.
  2987.  *      JavaStatusTypeError : The value was not the appropriate type
  2988.  *                            for the field and consequently was not set.
  2989.  */
  2990.  
  2991. JavaStatus
  2992. JavaClass_setFieldByName(JavaEnv env, JavaRef classRef,
  2993.     char *fieldName, JavaRef value);
  2994.  
  2995. /*
  2996.  * Function:    JavaClass_getFieldByID
  2997.  *
  2998.  * Description:
  2999.  *                Accesses a field of a class using an identifier
  3000.  *                for the field's name.
  3001.  *
  3002.  * Parameters:
  3003.  *                    env    : The execution environment.
  3004.  *
  3005.  *               classRef : The class whose field to be accessed.
  3006.  *
  3007.  *                  field : The identifier specifying the name of
  3008.  *                          the field.
  3009.  *
  3010.  *                 result : § The returned field value.
  3011.  *
  3012.  * Return status:
  3013.  *             JavaStatusOk : Operation completed normally.
  3014.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3015.  *       JavaStatusNotFound : The field with the specified name was not
  3016.  *                            found in the class.
  3017.  */
  3018.  
  3019. JavaStatus
  3020. JavaClass_getFieldByID(JavaEnv env, JavaRef obj,
  3021.     JavaRef field, JavaRef *result);
  3022.  
  3023. /*
  3024.  * Function:    JavaClass_setFieldByID
  3025.  *
  3026.  * Description:
  3027.  *                Set a field of a class using an identifier for
  3028.  *                the field's name.
  3029.  *
  3030.  * Parameters:
  3031.  *                    env    : The execution environment.
  3032.  *
  3033.  *               classRef : The class whose field to be accessed.
  3034.  *
  3035.  *                  field : The identifier specifying the name of
  3036.  *                          the field.
  3037.  *
  3038.  *                  value : The new value to store in the field.
  3039.  *
  3040.  * Return status:
  3041.  *             JavaStatusOk : Operation completed normally.
  3042.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3043.  *       JavaStatusNotFound : The field with the specified name was not
  3044.  *                            found in the class.
  3045.  *      JavaStatusTypeError : The value was not the appropriate type
  3046.  *                            for the field and consequently was not set.
  3047.  */
  3048.  
  3049. JavaStatus
  3050. JavaClass_setFieldByID(JavaEnv env, JavaRef obj,
  3051.     JavaRef field, JavaRef value);
  3052.  
  3053. /*
  3054.  * Function:    JavaClass_getField
  3055.  *
  3056.  * Description:
  3057.  *                Accesses a field of a class by index.
  3058.  *
  3059.  * Parameters:
  3060.  *                    env    : The execution environment.
  3061.  *
  3062.  *               classRef : The class whose field to be accessed.
  3063.  *
  3064.  *                  index : The index of the field to access.
  3065.  *
  3066.  *                 result : § The returned field value.
  3067.  *
  3068.  * Return status:
  3069.  *             JavaStatusOk : Operation completed normally.
  3070.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3071.  *       JavaStatusNotFound : The field with the specified name was not
  3072.  *                            found in the class.
  3073.  */
  3074.  
  3075. JavaStatus
  3076. JavaClass_getField(JavaEnv env, JavaRef obj,
  3077.     size_t index, JavaRef *result);
  3078.  
  3079. /*
  3080.  * Function:    JavaClass_setField
  3081.  *
  3082.  * Description:
  3083.  *                Sets a field of a class by index.
  3084.  *
  3085.  * Parameters:
  3086.  *                    env    : The execution environment.
  3087.  *
  3088.  *               classRef : The class whose field to be accessed.
  3089.  *
  3090.  *                  index : The index of the field to access.
  3091.  *
  3092.  *                  value : The new value to store in the field.
  3093.  *
  3094.  * Return status:
  3095.  *             JavaStatusOk : Operation completed normally.
  3096.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3097.  *       JavaStatusNotFound : The field with the specified name was not
  3098.  *                            found in the class.
  3099.  *      JavaStatusTypeError : The value was not the appropriate type
  3100.  *                            for the field and consequently was not set.
  3101.  */
  3102.  
  3103. JavaStatus
  3104. JavaClass_setField(JavaEnv env, JavaRef obj,
  3105.     size_t index, JavaRef value);
  3106.  
  3107. /*
  3108.  * Function:    JavaClass_getField_boolean
  3109.  *                JavaClass_getField_byte
  3110.  *                JavaClass_getField_char
  3111.  *                JavaClass_getField_short
  3112.  *                JavaClass_getField_int
  3113.  *                JavaClass_getField_long
  3114.  *                JavaClass_getField_float
  3115.  *                JavaClass_getField_double
  3116.  *
  3117.  * Description:
  3118.  *                Accesses a field of a class by index.
  3119.  *
  3120.  * Parameters:
  3121.  *                    env    : The execution environment.
  3122.  *
  3123.  *               classRef : The class whose field to be accessed.
  3124.  *
  3125.  *                  index : The index of the field to access.
  3126.  *
  3127.  *                 result : § The returned field value.
  3128.  *
  3129.  * Return status:
  3130.  *             JavaStatusOk : Operation completed normally.
  3131.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3132.  *       JavaStatusNotFound : The field with the specified name was not
  3133.  *                            found in the class.
  3134.  */
  3135.  
  3136. JavaStatus
  3137. JavaClass_getField_boolean(JavaEnv env, JavaRef obj,
  3138.     size_t index, JavaBoolean *result);
  3139.  
  3140. JavaStatus
  3141. JavaClass_getField_byte(JavaEnv env, JavaRef obj,
  3142.     size_t index, JavaByte *result);
  3143.  
  3144. JavaStatus
  3145. JavaClass_getField_char(JavaEnv env, JavaRef obj,
  3146.     size_t index, JavaChar *result);
  3147.  
  3148. JavaStatus
  3149. JavaClass_getField_short(JavaEnv env, JavaRef obj,
  3150.     size_t index, JavaShort *result);
  3151.  
  3152. JavaStatus
  3153. JavaClass_getField_int(JavaEnv env, JavaRef obj,
  3154.     size_t index, JavaInt *result);
  3155.  
  3156. JavaStatus
  3157. JavaClass_getField_long(JavaEnv env, JavaRef obj,
  3158.     size_t index, JavaLong *result);
  3159.  
  3160. JavaStatus
  3161. JavaClass_getField_float(JavaEnv env, JavaRef obj,
  3162.     size_t index, JavaFloat *result);
  3163.  
  3164. JavaStatus
  3165. JavaClass_getField_double(JavaEnv env, JavaRef obj,
  3166.     size_t index, JavaDouble *result);
  3167.  
  3168. /*
  3169.  * Function:    JavaClass_getFieldByName_boolean
  3170.  *                JavaClass_getFieldByName_byte
  3171.  *                JavaClass_getFieldByName_char
  3172.  *                JavaClass_getFieldByName_short
  3173.  *                JavaClass_getFieldByName_int
  3174.  *                JavaClass_getFieldByName_long
  3175.  *                JavaClass_getFieldByName_float
  3176.  *                JavaClass_getFieldByName_double
  3177.  *
  3178.  * Description:
  3179.  *                Accesses a field of a class by name.
  3180.  *
  3181.  * Parameters:
  3182.  *                    env    : The execution environment.
  3183.  *
  3184.  *               classRef : The class whose field to be accessed.
  3185.  *
  3186.  *              fieldName : The name of the field to access.
  3187.  *
  3188.  *                 result : § The returned field value.
  3189.  *
  3190.  * Return status:
  3191.  *             JavaStatusOk : Operation completed normally.
  3192.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3193.  *      JavaStatusTypeError : The field was not of appropriate type.
  3194.  *       JavaStatusNotFound : The field with the specified name was not
  3195.  *                            found in the class.
  3196.  */
  3197.  
  3198. JavaStatus
  3199. JavaClass_getFieldByName_boolean(JavaEnv env, JavaRef obj,
  3200.     char *fieldName, JavaBoolean *result);
  3201.  
  3202. JavaStatus
  3203. JavaClass_getFieldByName_byte(JavaEnv env, JavaRef obj,
  3204.     char *fieldName, JavaByte *result);
  3205.  
  3206. JavaStatus
  3207. JavaClass_getFieldByName_char(JavaEnv env, JavaRef obj,
  3208.     char *fieldName, JavaChar *result);
  3209.  
  3210. JavaStatus
  3211. JavaClass_getFieldByName_short(JavaEnv env, JavaRef obj,
  3212.     char *fieldName, JavaShort *result);
  3213.  
  3214. JavaStatus
  3215. JavaClass_getFieldByName_int(JavaEnv env, JavaRef obj,
  3216.     char *fieldName, JavaInt *result);
  3217.  
  3218. JavaStatus
  3219. JavaClass_getFieldByName_long(JavaEnv env, JavaRef obj,
  3220.     char *fieldName, JavaLong *result);
  3221.  
  3222. JavaStatus
  3223. JavaClass_getFieldByName_float(JavaEnv env, JavaRef obj,
  3224.     char *fieldName, JavaFloat *result);
  3225.  
  3226. JavaStatus
  3227. JavaClass_getFieldByName_double(JavaEnv env, JavaRef obj,
  3228.     char *fieldName, JavaDouble *result);
  3229.  
  3230. /*
  3231.  * Function:    JavaClass_setField_boolean
  3232.  *                JavaClass_setField_byte
  3233.  *                JavaClass_setField_char
  3234.  *                JavaClass_setField_short
  3235.  *                JavaClass_setField_int
  3236.  *                JavaClass_setField_long
  3237.  *                JavaClass_setField_float
  3238.  *                JavaClass_setField_double
  3239.  *
  3240.  * Description:
  3241.  *                Sets a field of a class by index.
  3242.  *
  3243.  * Parameters:
  3244.  *                    env    : The execution environment.
  3245.  *
  3246.  *               classRef : The class whose field to be accessed.
  3247.  *
  3248.  *                  index : The index of the field to access.
  3249.  *
  3250.  *                  value : The new value to store in the field.
  3251.  *
  3252.  * Return status:
  3253.  *             JavaStatusOk : Operation completed normally.
  3254.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3255.  *       JavaStatusNotFound : The field with the specified name was not
  3256.  *                            found in the class.
  3257.  *      JavaStatusTypeError : The value was not the appropriate type
  3258.  *                            for the field and consequently was not set.
  3259.  */
  3260.  
  3261. JavaStatus
  3262. JavaClass_setField_boolean(JavaEnv env, JavaRef obj,
  3263.     size_t index, JavaBoolean value);
  3264.  
  3265. JavaStatus
  3266. JavaClass_setField_byte(JavaEnv env, JavaRef obj,
  3267.     size_t index, JavaByte value);
  3268.  
  3269. JavaStatus
  3270. JavaClass_setField_char(JavaEnv env, JavaRef obj,
  3271.     size_t index, JavaChar value);
  3272.  
  3273. JavaStatus
  3274. JavaClass_setField_short(JavaEnv env, JavaRef obj,
  3275.     size_t index, JavaShort value);
  3276.  
  3277. JavaStatus
  3278. JavaClass_setField_int(JavaEnv env, JavaRef obj,
  3279.     size_t index, JavaInt value);
  3280.  
  3281. JavaStatus
  3282. JavaClass_setField_long(JavaEnv env, JavaRef obj,
  3283.     size_t index, JavaLong value);
  3284.  
  3285. JavaStatus
  3286. JavaClass_setField_float(JavaEnv env, JavaRef obj,
  3287.     size_t index, JavaFloat value);
  3288.  
  3289. JavaStatus
  3290. JavaClass_setField_double(JavaEnv env, JavaRef obj,
  3291.     size_t index, JavaDouble value);
  3292.  
  3293. /*
  3294.  * Function:    JavaClass_setFieldByName_boolean
  3295.  *                JavaClass_setFieldByName_byte
  3296.  *                JavaClass_setFieldByName_char
  3297.  *                JavaClass_setFieldByName_short
  3298.  *                JavaClass_setFieldByName_int
  3299.  *                JavaClass_setFieldByName_long
  3300.  *                JavaClass_setFieldByName_float
  3301.  *                JavaClass_setFieldByName_double
  3302.  *
  3303.  * Description:
  3304.  *                Sets a field of a class by name.
  3305.  *
  3306.  * Parameters:
  3307.  *                    env    : The execution environment.
  3308.  *
  3309.  *               classRef : The class whose field to be accessed.
  3310.  *
  3311.  *                  index : The index of the field to access.
  3312.  *
  3313.  *                  value : The new value to store in the field.
  3314.  *
  3315.  * Return status:
  3316.  *             JavaStatusOk : Operation completed normally.
  3317.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3318.  *       JavaStatusNotFound : The field with the specified name was not
  3319.  *                            found in the class.
  3320.  *      JavaStatusTypeError : The value was not the appropriate type
  3321.  *                            for the field and consequently was not set.
  3322.  */
  3323.  
  3324. JavaStatus
  3325. JavaClass_setFieldByName_boolean(JavaEnv env, JavaRef obj,
  3326.     char *fieldName, JavaBoolean value);
  3327.  
  3328. JavaStatus
  3329. JavaClass_setFieldByName_byte(JavaEnv env, JavaRef obj,
  3330.     char *fieldName, JavaByte value);
  3331.  
  3332. JavaStatus
  3333. JavaClass_setFieldByName_char(JavaEnv env, JavaRef obj,
  3334.     char *fieldName, JavaChar value);
  3335.  
  3336. JavaStatus
  3337. JavaClass_setFieldByName_short(JavaEnv env, JavaRef obj,
  3338.     char *fieldName, JavaShort value);
  3339.  
  3340. JavaStatus
  3341. JavaClass_setFieldByName_int(JavaEnv env, JavaRef obj,
  3342.     char *fieldName, JavaInt value);
  3343.  
  3344. JavaStatus
  3345. JavaClass_setFieldByName_long(JavaEnv env, JavaRef obj,
  3346.     char *fieldName, JavaLong value);
  3347.  
  3348. JavaStatus
  3349. JavaClass_setFieldByName_float(JavaEnv env, JavaRef obj,
  3350.     char *fieldName, JavaFloat value);
  3351.  
  3352. JavaStatus
  3353. JavaClass_setFieldByName_double(JavaEnv env, JavaRef obj,
  3354.     char *fieldName, JavaDouble value);
  3355.  
  3356. /*
  3357.  * Function:    JavaIdent_make
  3358.  *
  3359.  * Description:
  3360.  *                Constructs a new identifier.
  3361.  *
  3362.  * Parameters:
  3363.  *                    env    : The execution environment.
  3364.  *
  3365.  *                 result : § The newly constructed identifier.
  3366.  *
  3367.  *                   name : The identifier's name. The name must
  3368.  *                          be a String object.
  3369.  *
  3370.  * Return status:
  3371.  *             JavaStatusOk : Operation completed normally.
  3372.  *  JavaStatusExceptionThrow : An exception was thrown by Java.
  3373.  *                               The exception can be obtained by
  3374.  *                               calling JavaEnv_exceptionOccurred().
  3375.  */
  3376.  
  3377. JavaStatus
  3378. JavaIdent_make(JavaEnv env, JavaRef *result, JavaRef name);
  3379.  
  3380. /*
  3381.  * Function:    JavaIdent_getName
  3382.  *
  3383.  * Description:
  3384.  *                Gets the name of an identifier.
  3385.  *
  3386.  * Parameters:
  3387.  *                    env    : The execution environment.
  3388.  *
  3389.  *                     id : The Java Identifier whose name is to
  3390.  *                          be returned.
  3391.  *
  3392.  *                 result : § The resulting name String object.
  3393.  *
  3394.  * Return status:
  3395.  *             JavaStatusOk : Operation completed normally.
  3396.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3397.  *      JavaStatusTypeError : The object was not an Identifier object.
  3398.  */
  3399.  
  3400. JavaStatus
  3401. JavaIdent_getName(JavaEnv env, JavaRef id, JavaRef *result);
  3402.  
  3403. /*
  3404.  * Function:    JavaString_make
  3405.  *
  3406.  * Description:
  3407.  *                Constructs a new Java String object from an array
  3408.  *                of Unicode characters.
  3409.  *
  3410.  * Parameters:
  3411.  *                    env    : The execution environment.
  3412.  *
  3413.  *                 result : § The newly constructed String.
  3414.  *
  3415.  *                  bytes : The array of Unicode characters. This
  3416.  *                          array need not be null-terminated.
  3417.  *
  3418.  *                 length : The count of characters in the array.
  3419.  *
  3420.  * Return status:
  3421.  *             JavaStatusOk : Operation completed normally.
  3422.  *  JavaStatusExceptionThrow : An exception was thrown by Java.
  3423.  *                               The exception can be obtained by
  3424.  *                               calling JavaEnv_exceptionOccurred().
  3425.  */
  3426.  
  3427. JavaStatus
  3428. JavaString_make(JavaEnv env, JavaRef *result,
  3429.     JavaChar *bytes, size_t length);
  3430.  
  3431. /*
  3432.  * Function:    JavaString_length
  3433.  *
  3434.  * Description:
  3435.  *                Returns the length of a String.
  3436.  *
  3437.  * Parameters:
  3438.  *                    env    : The execution environment.
  3439.  *
  3440.  *                 string : The string.
  3441.  *
  3442.  *                 result : § The resulting length.
  3443.  *
  3444.  * Return status:
  3445.  *             JavaStatusOk : Operation completed normally.
  3446.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3447.  *      JavaStatusTypeError : The object was not a String object.
  3448.  */
  3449.  
  3450. JavaStatus
  3451. JavaString_length(JavaEnv env, JavaRef string, size_t *result);
  3452.  
  3453. /*
  3454.  * Function:    JavaString_getChars
  3455.  *
  3456.  * Description:
  3457.  *                Gets a range of Unicode characters from a String.
  3458.  *
  3459.  * Parameters:
  3460.  *                    env    : The execution environment.
  3461.  *
  3462.  *                 string : The string.
  3463.  *
  3464.  *                 offset : The start offset of the range.
  3465.  *
  3466.  *                 length : The length of the range. If the length
  3467.  *                          is -1, the range up to the end of the
  3468.  *                          string is returned.
  3469.  *
  3470.  *           resultBuffer : § A buffer whose contents will be set
  3471.  *                          to the desired range of characters. The
  3472.  *                          result buffer must be long enough to
  3473.  *                          contain the length requested.
  3474.  *
  3475.  * Return status:
  3476.  *             JavaStatusOk : Operation completed normally.
  3477.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3478.  *      JavaStatusTypeError : The object was not a String object.
  3479.  */
  3480.  
  3481. JavaStatus
  3482. JavaString_getChars(JavaEnv env, JavaRef string, size_t offset,
  3483.     long length, JavaChar *resultBuffer);
  3484.  
  3485. /*
  3486.  * Function:    JavaString_setChars
  3487.  *
  3488.  * Description:
  3489.  *                Sets a range of Unicode characters in a String.
  3490.  *
  3491.  * Parameters:
  3492.  *                    env    : The execution environment.
  3493.  *
  3494.  *                 string : The string.
  3495.  *
  3496.  *                 offset : The start offset of the range.
  3497.  *
  3498.  *                 length : The length of the range. If the length
  3499.  *                          is -1, the range up to the end of the
  3500.  *                          string is set.
  3501.  *
  3502.  *                    buffer : § A buffer whose contents will be copied
  3503.  *                          to the desired range of characters. The
  3504.  *                          buffer must be at least as long as the
  3505.  *                          requested length to set.
  3506.  *
  3507.  * Return status:
  3508.  *             JavaStatusOk : Operation completed normally.
  3509.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3510.  *      JavaStatusTypeError : The object was not a String object.
  3511.  */
  3512.  
  3513. JavaStatus
  3514. JavaString_setChars(JavaEnv env, JavaRef string, size_t offset,
  3515.     long length, JavaChar *buffer);
  3516.  
  3517. /*
  3518.  * Function:    JavaString_makeUTF
  3519.  *
  3520.  * Description:
  3521.  *                Constructs a new Java String object from a UTF
  3522.  *                character array.
  3523.  *
  3524.  * Parameters:
  3525.  *                    env    : The execution environment.
  3526.  *
  3527.  *                 result : § The newly constructed String.
  3528.  *
  3529.  *                  bytes : The array of UTF characters. This
  3530.  *                          array need not be null-terminated.
  3531.  *
  3532.  *                 length : The count of characters in the array.
  3533.  *                          If the length is specified as -1, the
  3534.  *                          bytes are assumed to be null terminated.
  3535.  *
  3536.  * Return status:
  3537.  *             JavaStatusOk : Operation completed normally.
  3538.  *  JavaStatusExceptionThrow : An exception was thrown by Java.
  3539.  *                               The exception can be obtained by
  3540.  *                               calling JavaEnv_exceptionOccurred().
  3541.  */
  3542.  
  3543. JavaStatus
  3544. JavaString_makeUTF(JavaEnv env, JavaRef *result, 
  3545.     char *bytes, size_t length);
  3546.  
  3547. /*
  3548.  * Function:    JavaString_UTFLength
  3549.  *
  3550.  * Description:
  3551.  *                Returns the length of the UTF character array of a
  3552.  *                string. Since UTF is a multi-byte representation, the
  3553.  *                UTF length will not necessarily be the same as the
  3554.  *                number of characters in the string, returned by the
  3555.  *                JavaString_length() operation.
  3556.  *
  3557.  * Parameters:
  3558.  *                    env    : The execution environment.
  3559.  *
  3560.  *                 string : The string.
  3561.  *
  3562.  *                 result : § The resulting length.
  3563.  *
  3564.  * Return status:
  3565.  *             JavaStatusOk : Operation completed normally.
  3566.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3567.  *      JavaStatusTypeError : The object was not a String object.
  3568.  */
  3569.  
  3570. JavaStatus
  3571. JavaString_UTFLength(JavaEnv env, JavaRef string, size_t *result);
  3572.  
  3573. /*
  3574.  * Function:    JavaString_getUTFChars
  3575.  *
  3576.  * Description:
  3577.  *                Returns a range of characters as a UTF character array.
  3578.  *                The offset and length specify the position in terms of
  3579.  *                characters, not UTF bytes.
  3580.  *
  3581.  * Parameters:
  3582.  *                    env    : The execution environment.
  3583.  *
  3584.  *                 string : The string.
  3585.  *
  3586.  *                 offset : The start offset of the range.
  3587.  *
  3588.  *                 length : The length of the range. If the length
  3589.  *                          is -1, the range up to the end of the
  3590.  *                          string is returned.
  3591.  *
  3592.  *           resultBuffer : § A buffer whose contents will be set
  3593.  *                          to the desired range of characters. The
  3594.  *                          result buffer must be long enough to
  3595.  *                          contain the length requested.
  3596.  *
  3597.  * Return status:
  3598.  *             JavaStatusOk : Operation completed normally.
  3599.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3600.  *      JavaStatusTypeError : The object was not a String object.
  3601.  */
  3602.  
  3603. JavaStatus
  3604. JavaString_getUTFChars(JavaEnv env, JavaRef string, size_t offset,
  3605.     long length, char *resultBuffer);
  3606.  
  3607. /*
  3608.  * Function:    JavaString_getStr255
  3609.  *
  3610.  * Description:
  3611.  *                Returns a range of characters as a UTF character array.
  3612.  *                The offset and length specify the position in terms of
  3613.  *                characters, not UTF bytes.
  3614.  *
  3615.  * Parameters:
  3616.  *                    env    : The execution environment.
  3617.  *
  3618.  *                 string : The string.
  3619.  *
  3620.  *           resultBuffer : § A buffer whose contents will be set
  3621.  *                          to the desired range of characters. The
  3622.  *                          result buffer must be long enough to
  3623.  *                          contain the length requested.
  3624.  *
  3625.  * Return status:
  3626.  *             JavaStatusOk : Operation completed normally.
  3627.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3628.  *      JavaStatusTypeError : The object was not a String object.
  3629.  */
  3630.  
  3631. JavaStatus
  3632. JavaString_getStr255(JavaEnv env, JavaRef string, UInt8 *resultBuffer);
  3633.  
  3634. /*
  3635.  * Function:    JavaString_getHandle
  3636.  *
  3637.  * Description:
  3638.  *                Takes a Java string and returns a handle to a C string.
  3639.  *
  3640.  * Parameters:
  3641.  *                    env    : The execution environment.
  3642.  *
  3643.  *                 string : The string.
  3644.  *
  3645.  *           resultHandle : § .
  3646.  *
  3647.  * Return status:
  3648.  *             JavaStatusOk : Operation completed normally.
  3649.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3650.  *      JavaStatusTypeError : The object was not a String object.
  3651.  */
  3652.  
  3653. JavaStatus
  3654. JavaString_getHandle(JavaEnv env, JavaRef string,
  3655.     size_t offset, long length, Handle *resultHandle);
  3656.  
  3657. /*
  3658.  * Function:    JavaString_setUTFChars
  3659.  *
  3660.  * Description:
  3661.  *                Sets a range of characters as a UTF character array.
  3662.  *                The offset and length specify the position in terms
  3663.  *                of characters, not UTF bytes.
  3664.  *
  3665.  * Parameters:
  3666.  *                    env    : The execution environment.
  3667.  *
  3668.  *                 string : The string.
  3669.  *
  3670.  *                 offset : The start offset of the range.
  3671.  *
  3672.  *                 length : The length of the range. If the length
  3673.  *                          is -1, the range up to the end of the
  3674.  *                          string is set.
  3675.  *
  3676.  *                    buffer : § A buffer whose contents will be copied
  3677.  *                          to the desired range of characters. The
  3678.  *                          buffer must be at least as long as the
  3679.  *                          requested length to set.
  3680.  *
  3681.  * Return status:
  3682.  *             JavaStatusOk : Operation completed normally.
  3683.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3684.  *      JavaStatusTypeError : The object was not a String object.
  3685.  */
  3686.  
  3687. JavaStatus
  3688. JavaString_setUTFChars(JavaEnv env, JavaRef string, size_t offset,
  3689.     long length, char *buffer);
  3690.  
  3691. /*
  3692.  * Function:    JavaString_makeStr255
  3693.  *
  3694.  * Description:
  3695.  *                Constructs a new Java String object from a pascal
  3696.  *                style character array.
  3697.  *
  3698.  * Parameters:
  3699.  *                    env    : The execution environment.
  3700.  *
  3701.  *                 result : § The newly constructed String.
  3702.  *
  3703.  *                 theStr : The array of pascal characters.
  3704.  *
  3705.  * Return status:
  3706.  *             JavaStatusOk : Operation completed normally.
  3707.  *  JavaStatusExceptionThrow : An exception was thrown by Java.
  3708.  *                               The exception can be obtained by
  3709.  *                               calling JavaEnv_exceptionOccurred().
  3710.  */
  3711.  
  3712. JavaStatus
  3713. JavaString_makeStr255(JavaEnv env, JavaRef *result, ConstStr255Param theStr);
  3714.  
  3715. /*
  3716.  * Function:    JavaArray_length
  3717.  *
  3718.  * Description:
  3719.  *                Returns the length of the specified array.
  3720.  *
  3721.  * Parameters:
  3722.  *                    env    : The execution environment.
  3723.  *
  3724.  *                 string : The string.
  3725.  *
  3726.  *                 result : § The resulting length.
  3727.  *
  3728.  * Return status:
  3729.  *             JavaStatusOk : Operation completed normally.
  3730.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3731.  *      JavaStatusTypeError : The object was not a String object.
  3732.  */
  3733.  
  3734. JavaStatus
  3735. JavaArray_length(JavaEnv env, JavaRef array, size_t *result);
  3736.  
  3737. /*
  3738.  * Function:    JavaArray_getElement
  3739.  *
  3740.  * Description:
  3741.  *                Get the element at the specified index.
  3742.  *
  3743.  * Parameters:
  3744.  *                    env    : The execution environment.
  3745.  *
  3746.  *                  array : The array.
  3747.  *
  3748.  *                  index : Zero-based index.
  3749.  *
  3750.  *                 result : § The resulting reference.
  3751.  *
  3752.  * Return status:
  3753.  *             JavaStatusOk : Operation completed normally.
  3754.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3755.  *      JavaStatusTypeError : The object was not an array object.
  3756.  */
  3757.  
  3758. JavaStatus
  3759. JavaArray_getElement(JavaEnv env, JavaRef array, size_t index, JavaRef *result);
  3760.  
  3761. /*
  3762.  * Function:    JavaArray_setElement
  3763.  *
  3764.  * Description:
  3765.  *                Set the element at the specified index to the
  3766.  *                specified object.
  3767.  *
  3768.  * Parameters:
  3769.  *                    env    : The execution environment.
  3770.  *
  3771.  *                  array : The array.
  3772.  *
  3773.  *                  index : Zero-based index.
  3774.  *
  3775.  *                element : The element reference.
  3776.  *
  3777.  * Return status:
  3778.  *             JavaStatusOk : Operation completed normally.
  3779.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3780.  *      JavaStatusTypeError : The object was not an array object.
  3781.  */
  3782.  
  3783. JavaStatus
  3784. JavaArray_setElement(JavaEnv env, JavaRef array, size_t index, JavaRef element);
  3785.  
  3786. /*
  3787.  * Function:    JavaArray_elementSize
  3788.  *
  3789.  * Description:
  3790.  *                Returns the size of an element in the specified array.
  3791.  *
  3792.  * Parameters:
  3793.  *                    env    : The execution environment.
  3794.  *
  3795.  *                 string : The string.
  3796.  *
  3797.  *                 result : § The resulting size.
  3798.  *
  3799.  * Return status:
  3800.  *             JavaStatusOk : Operation completed normally.
  3801.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3802.  *      JavaStatusTypeError : The object was not an array object.
  3803.  */
  3804.  
  3805. JavaStatus
  3806. JavaArray_elementSize(JavaEnv env, JavaRef array, size_t *result);
  3807.  
  3808. /*
  3809.  * Function:    JavaArray_baseAddr
  3810.  *
  3811.  * Description:
  3812.  *                Returns the address of the first element in the specified array.
  3813.  *
  3814.  * N.B.: This routine should only be used for direct copy
  3815.  *         operations. Note that the VM reserves the right to
  3816.  *         move object, arrays, and classes in memory at ANY
  3817.  *         moment. This is especially true in preemptive
  3818.  *         systems. Make sure all your references to objects
  3819.  *         etc are indirect through JavaRef.
  3820.  *
  3821.  * Parameters:
  3822.  *                    env    : The execution environment.
  3823.  *
  3824.  *                 string : The string.
  3825.  *
  3826.  *                 result : § The resulting pointer.
  3827.  *
  3828.  * Return status:
  3829.  *             JavaStatusOk : Operation completed normally.
  3830.  *     JavaStatusParamError : Some parameter was not a valid reference.
  3831.  *      JavaStatusTypeError : The object was not an array object.
  3832.  */
  3833.  
  3834. JavaStatus
  3835. JavaArray_baseAddr(JavaEnv env, JavaRef array, void **result);
  3836.  
  3837. /*
  3838.  * Function:    JavaDebug_printRef
  3839.  *
  3840.  * Description:
  3841.  *
  3842.  * Parameters:
  3843.  *                    env    : The execution environment.
  3844.  *
  3845.  *
  3846.  */
  3847.  
  3848. void
  3849. JavaDebug_printRef(JavaEnv env, JavaRef ref);
  3850.  
  3851. /*
  3852.  * Function:    JavaDebug_dumpMonitors
  3853.  *
  3854.  * Description:
  3855.  *
  3856.  * Parameters:
  3857.  *                runtime    : The runtime instance.
  3858.  *
  3859.  *
  3860.  */
  3861.  
  3862. void
  3863. JavaDebug_dumpMonitors(JavaRuntime runtime);
  3864.  
  3865. /*
  3866.  * Function:    JavaDebug_dumpThreads
  3867.  *
  3868.  * Description:
  3869.  *
  3870.  * Parameters:
  3871.  *                runtime    : The runtime instance.
  3872.  *
  3873.  *
  3874.  */
  3875.  
  3876. void
  3877. JavaDebug_dumpThreads(JavaRuntime runtime);
  3878.  
  3879. /*
  3880.  * Function:    JavaDebug_log
  3881.  *
  3882.  * Description:
  3883.  *                Appends a printf-style string to a file named "sys_log"
  3884.  *                that is created and/or located in the home directory of the
  3885.  *                running applet or application.
  3886.  *
  3887.  * Parameters:
  3888.  *                runtime    : The execution environment.
  3889.  *
  3890.  *
  3891.  */
  3892.  
  3893. void
  3894. JavaDebug_log(char *fmt, ...);
  3895.  
  3896. /*
  3897.  * Function:    JavaDebug_printFrameStack
  3898.  *
  3899.  * Description:
  3900.  *                Prints out a stack trace.
  3901.  *
  3902.  * Parameters:
  3903.  *                runtime    : The execution environment.
  3904.  *
  3905.  *
  3906.  */
  3907.  
  3908. void
  3909. JavaDebug_printFrameStack(JavaEnv env);
  3910.  
  3911. /*
  3912.  * Function:    JavaDebug_setStartupClass
  3913.  *
  3914.  * Description:
  3915.  *                Given a classname and method, the runtime sets a flag to make
  3916.  *                that method the "main" routine of the application.
  3917.  *
  3918.  * Parameters:
  3919.  *                runtime    : The execution environment.
  3920.  *
  3921.  *
  3922.  */
  3923.  
  3924. JavaStatus
  3925. JavaDebug_setStartupClass(JavaRuntime runtime,
  3926.     char *className, char *methodName, char *methodSignature);
  3927.  
  3928. /*
  3929.  * Function:    JavaMemory_Allocate
  3930.  *
  3931.  * Description:
  3932.  *                Allocates memory from the Java heap.
  3933.  *
  3934.  * Parameters:
  3935.  *                    env    : The execution environment.
  3936.  *
  3937.  *
  3938.  */
  3939.  
  3940. void *
  3941. JavaMemory_Allocate(JavaEnv env, size_t numBytes);
  3942.  
  3943. /*
  3944.  * Function:    JavaMemory_Free
  3945.  *
  3946.  * Description:
  3947.  *                Frees memory to the Java heap space.
  3948.  *
  3949.  * Parameters:
  3950.  *                    env    : The execution environment.
  3951.  *
  3952.  *
  3953.  */
  3954.  
  3955. void
  3956. JavaMemory_Free(JavaEnv env, void *ptr);
  3957.  
  3958. /*
  3959.  * Function:    JavaThread_currentEnv
  3960.  *
  3961.  * Description:
  3962.  *                Returns the JavaEnv from the current thread.
  3963.  *
  3964.  * Parameters:
  3965.  *
  3966.  * Return value:
  3967.  */
  3968.  
  3969. JavaEnv
  3970. JavaThread_currentEnv(void);
  3971.  
  3972. /*
  3973.  * Function:    JavaThread_sleep
  3974.  *
  3975.  * Description:
  3976.  *                Puts the current thread to sleep.
  3977.  *
  3978.  * Parameters:
  3979.  *                    sleep : Number of ticks for the thread to sleep.
  3980.  *
  3981.  * Return value:
  3982.  */
  3983.  
  3984. void
  3985. JavaThread_sleep(JavaLong sleep);
  3986.  
  3987. /*
  3988.  * Function:    JavaThread_yield
  3989.  *
  3990.  * Description:
  3991.  *                Yields execution to the thread scheduler.
  3992.  *
  3993.  * Parameters:
  3994.  *
  3995.  * Return value:
  3996.  */
  3997.  
  3998. void
  3999. JavaThread_yield(void);
  4000.  
  4001. /*
  4002.  * Function:    JavaClass_compile
  4003.  *
  4004.  * Description:
  4005.  *                Compiles the source of a class definition into a class object.
  4006.  *
  4007.  * Parameters:
  4008.  *                    env    : The execution environment.
  4009.  *
  4010.  *               classDef : The source of the class to be compiled. The
  4011.  *                          definition is specified as a UTF string.
  4012.  *
  4013.  *            classDefLen : The length in bytes of the classDef parameter.
  4014.  *
  4015.  *         resultingClass : § The resulting class object.
  4016.  *
  4017.  * Return status:
  4018.  *             JavaStatusOk : Operation completed normally.
  4019.  * JavaStatusExceptionThrown: An exception was thrown by the Java. The exception
  4020.  *                              can be obtained by calling JavaEnv_exceptionOccurred().
  4021.  */
  4022.  
  4023. JavaStatus
  4024. JavaClass_compile(JavaEnv env, char *classDef,
  4025.     size_t classDefLen, JavaRef *resultingClass);
  4026.  
  4027. /*
  4028.  * Function:    JavaExpr_compile
  4029.  *
  4030.  * Description:
  4031.  *                Compiles the source of an expression into an object which may
  4032.  *                be evaluated.
  4033.  *
  4034.  * Parameters:
  4035.  *                    env    : The execution environment.
  4036.  *
  4037.  *                   expr : The source of the Java expression to be compiled. The
  4038.  *                          definition is specified as a UTF string.
  4039.  *
  4040.  *                exprLen : The length in bytes of the expr parameter.
  4041.  *
  4042.  *          resultingExpr : § The resulting compiled expression object.
  4043.  *
  4044.  * Return status:
  4045.  *             JavaStatusOk : Operation completed normally.
  4046.  * JavaStatusExceptionThrown: An exception was thrown by the Java. The exception
  4047.  *                              can be obtained by calling JavaEnv_exceptionOccurred().
  4048.  */
  4049.  
  4050. JavaStatus
  4051. JavaExpr_compile(JavaEnv env, char *expr,
  4052.     size_t exprLen, JavaRef *resultingExpr);
  4053.  
  4054. /*
  4055.  * Function:    JavaExpr_eval
  4056.  *
  4057.  * Description:
  4058.  *                Evaulates an expression object.
  4059.  *
  4060.  * Parameters:
  4061.  *                    env    : The execution environment.
  4062.  *
  4063.  *                exprRef : The Java expression to be evaluated.
  4064.  *
  4065.  *                 result : § The resulting value of the expression. Specifying.
  4066.  *                          a NULL pointer indicates that the result is not desired.
  4067.  *
  4068.  * Return status:
  4069.  *             JavaStatusOk : Operation completed normally.
  4070.  * JavaStatusExceptionThrown: An exception was thrown by the Java. The exception
  4071.  *                              can be obtained by calling JavaEnv_exceptionOccurred().
  4072.  */
  4073.  
  4074. JavaStatus
  4075. JavaExpr_eval(JavaEnv env, JavaRef expr, JavaRef *result);
  4076.  
  4077. /*
  4078.  * Function:    JavaEnv_getFrameCount
  4079.  *
  4080.  * Description:
  4081.  *                Returns the number of currently active stack frames in an
  4082.  *                environment. A stack frame to associated with each pending
  4083.  *                method invocation.
  4084.  *
  4085.  * Parameters:
  4086.  *                    env    : The execution environment.
  4087.  *
  4088.  * Return value:
  4089.  *                The resulting count of the number of frames.
  4090.  */
  4091.  
  4092. size_t
  4093. JavaEnv_getFrameCount(JavaEnv env);
  4094.  
  4095. /*
  4096.  * Function:    JavaEnv_getFrameInfo
  4097.  *
  4098.  * Description:
  4099.  *                Returns information about a particular stack frame. Stack
  4100.  *                frames are referenced by index, the oldest being at index 0,
  4101.  *                and the current at JavaEnv_getFrameCount() - 1.
  4102.  *
  4103.  * Parameters:
  4104.  *                    env    : The execution environment.
  4105.  *
  4106.  *             frameIndex : The index of the frame for which information is
  4107.  *                          desired. Specifying a frame index of -1 is equivalent
  4108.  *                          to the current frame.
  4109.  *
  4110.  *            methodClass : § The resulting class which implements the method
  4111.  *                          being invoked in the frame. Note that this may be
  4112.  *                          different from the class of the object. Specifying a
  4113.  *                          NULL pointer indicates that the result is not desired.
  4114.  *
  4115.  *             methodName : § The resulting name of the method being invoked in
  4116.  *                          the frame. Specifying a NULL pointer indicate that the
  4117.  *                          result is not desired.
  4118.  *
  4119.  *              methodSig : § The resulting signature of the method being invoked
  4120.  *                          in the frame. Specifying a NULL pointer indicates that
  4121.  *                          the result is not desired.
  4122.  *
  4123.  *               varCount : § The resulting count of the number of local variables
  4124.  *                          in the frame. This count includes the formal paramaters
  4125.  *                          of the method. Specifying a NULL pointer indicates that
  4126.  *                          the result is not desired.
  4127.  *
  4128.  * Return status:
  4129.  *             JavaStatusOk : Operation completed normally.
  4130.  *     JavaStatusParamError : The frameIndex did not specify a valid frame.
  4131.  */
  4132.  
  4133. JavaStatus
  4134. JavaEnv_getFrameInfo(JavaEnv env, size_t frameIndex,
  4135.     JavaBoolean *isClassMonitor, JavaBoolean *isObjectMonitor,
  4136.         char **methodClass, char **methodName, char **methodSig, size_t *varCount);
  4137.  
  4138. /*
  4139.  * Function:    JavaEnv_getVarInfo
  4140.  *
  4141.  * Description:
  4142.  *                Returns the name and signature of a local variable if debugging
  4143.  *                information is available.
  4144.  *
  4145.  * Parameters:
  4146.  *                    env    : The execution environment.
  4147.  *
  4148.  *             frameIndex : The index of the frame for which information is
  4149.  *                          desired. Specifying a frame index of -1 is equivalent
  4150.  *                          to the current frame.
  4151.  *
  4152.  *               varIndex : The index of the local variable for which the value
  4153.  *                          is desired.
  4154.  *
  4155.  *                   name : § The resulting name of the local variable. The name
  4156.  *                          is returned as an identifier. Specifying a NULL pointer
  4157.  *                          indicates that the result is not desired.
  4158.  *
  4159.  *              signature : § The resulting signature of the local variable. The
  4160.  *                          signature is returned as an identifier. Specifying a
  4161.  *                          NULL poiner indicates that the result is not desired.
  4162.  *
  4163.  * Return value:
  4164.  *             JavaStatusOk : Operation completed normally.
  4165.  *     JavaStatusParamError : The frameIndex did not specify a valid frame or the
  4166.  *                            varIndex did not specify a valid local variable index.
  4167.  *       JavaStatusNotFound : The name and the signature were not available because
  4168.  *                            no debugging information was available.
  4169.  */
  4170.  
  4171. JavaStatus
  4172. JavaEnv_getVarInfo(JavaEnv env, size_t frameIndex,
  4173.     size_t varIndex, char **name, char **signature);
  4174.  
  4175. /*
  4176.  * Function:    JavaEnv_getVarValue
  4177.  *
  4178.  * Description:
  4179.  *                Returns the name and signature of a local variable if debugging
  4180.  *                information is available.
  4181.  *
  4182.  * Parameters:
  4183.  *                    env    : The execution environment.
  4184.  *
  4185.  *             frameIndex : The index of the frame for which information is
  4186.  *                          desired. Specifying a frame index of -1 is equivalent
  4187.  *                          to the current frame.
  4188.  *
  4189.  *               varIndex : The index of the local variable for which the value
  4190.  *                          is desired.
  4191.  *
  4192.  *                 buffer : § .
  4193.  *
  4194.  *           bufferLength : § .
  4195.  *
  4196.  * Return value:
  4197.  *             JavaStatusOk : Operation completed normally.
  4198.  *     JavaStatusParamError : The frameIndex did not specify a valid frame or the
  4199.  *                            varIndex did not specify a valid local variable index.
  4200.  *       JavaStatusNotFound : The name and the signature were not available because
  4201.  *                            no debugging information was available.
  4202.  */
  4203.  
  4204. JavaStatus
  4205. JavaEnv_getVarValue(JavaEnv env, size_t frameIndex,
  4206.     size_t varIndex, char *buffer, size_t bufferLength);
  4207.  
  4208. /*
  4209.  * Function:    JavaEnv_getSourceInfo
  4210.  *
  4211.  * Description:
  4212.  *                Returns the source file name and line number corresponding to
  4213.  *                the current instruction being executed if debugging information
  4214.  *                is available.
  4215.  *
  4216.  * Parameters:
  4217.  *                    env    : The execution environment.
  4218.  *
  4219.  *             frameIndex : The index of the frame for which information is
  4220.  *                          desired. Specifying a frame index of -1 is equivalent
  4221.  *                          to the current frame.
  4222.  *
  4223.  *               filename : § The resulting filename from which the method associated
  4224.  *                          with the specified frame was compiled. Specifying a NULL
  4225.  *                          pointer indicates that the result is not desired.
  4226.  *
  4227.  *             lineNumber : § The resulting line number in the file. Specifying a
  4228.  *                          NULL pointer indicates that the result is not desired.
  4229.  *
  4230.  * Return value:
  4231.  *             JavaStatusOk : Operation completed normally.
  4232.  *     JavaStatusParamError : The frameIndex did not specify a valid frame.
  4233.  *       JavaStatusNotFound : The source information was not available because no
  4234.  *                            debugging information was available.
  4235.  */
  4236.  
  4237. JavaStatus
  4238. JavaEnv_getSourceInfo(JavaEnv env,
  4239.     size_t frameIndex, char **filename, size_t *lineNumber);
  4240.  
  4241. /*
  4242.  * Function:    JavaEnv_getBytecodeInfo
  4243.  *
  4244.  * Description:
  4245.  *                Returns the source file name and line number corresponding to
  4246.  *                the current instruction being executed if debugging information
  4247.  *                is available.
  4248.  *
  4249.  * Parameters:
  4250.  *                    env    : The execution environment.
  4251.  *
  4252.  *             frameIndex : The index of the frame for which information is
  4253.  *                          desired. Specifying a frame index of -1 is equivalent
  4254.  *                          to the current frame.
  4255.  *
  4256.  *              className : § .
  4257.  *
  4258.  *            methodIndex : § .
  4259.  *
  4260.  *           methodOffset : § .
  4261.  *
  4262.  * Return value:
  4263.  *             JavaStatusOk : Operation completed normally.
  4264.  *     JavaStatusParamError : The frameIndex did not specify a valid frame.
  4265.  *       JavaStatusNotFound : The source information was not available because no
  4266.  *                            debugging information was available.
  4267.  */
  4268.  
  4269. JavaStatus
  4270. JavaEnv_getBytecodeInfo(JavaEnv env,
  4271.     size_t frameIndex, char **className, size_t *methodIndex, size_t *methodOffset);
  4272.  
  4273. /*
  4274.  * Function:    JavaRuntime_profileDump
  4275.  *
  4276.  * Description:
  4277.  *                Dumps profile information to a file.
  4278.  *
  4279.  * Parameters:
  4280.  *                    env    : The execution environment.
  4281.  *
  4282.  * Return value:
  4283.  *             JavaStatusOk : Operation completed normally.
  4284.  * JavaStatusExceptionThrown: An exception was thrown by the Java. The exception
  4285.  *                              can be obtained by calling JavaEnv_exceptionOccurred().
  4286.  */
  4287.  
  4288. JavaStatus
  4289. JavaRuntime_profileDump(JavaRuntime runtime, char *filename);
  4290.  
  4291. #if PRAGMA_IMPORT_SUPPORTED
  4292. #pragma import off
  4293. #endif
  4294.  
  4295. #ifdef __cplusplus
  4296. }
  4297. #endif
  4298.  
  4299. #endif __RoasterVM__